Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

 How to return the first / last non blank cell in a row or column?

When you work with a worksheet, sometimes, you may want to get the first or last non blank cell value of a row or column. It is easy for you to get the value if there are few data in a row or column at a glance, but to return the data in a long column or row will be a painful task. Here, I can talk you about some useful methods to solve this job.

Return the first non blank cell in a row or column with formula

Return the last non blank cell in a row or column with formula


Combine multiple worksheets, workbooks and csv files into one worksheet / workbook:
In your daily work, to combine multiple worksheets or workbooks into one single worksheet or workbook may be a huge and headachy work. But, if you have Kutools for Excel, with its powerful utility – Combine, you can quickly combine multiple worksheets, workbooks into one worksheet or workbook.
doc combine multiple worksheets-1

arrow blue right bubble Return the first non blank cell in a row or column with formula


To extract the first cell with data, please apply the following formula:

1. Enter the following formula into a blank cell besides your data: =INDEX(A1:A13,MATCH(TRUE,INDEX((A1:A13<>0),0),0)), see screenshot:

doc-return-first-data-cell-1

2. Then press Enter key, and you will get the first non blank cell value as follows:

doc-return-first-data-cell-1

Notes:

1. In the above formula, A1:A13 is the column range that you want to use, you can change it to your need. This formula also can be applied to get the first non blank cell value in a row, you just need to change the column range to row range.

2. This formula just work correctly on single row or single column.


arrow blue right bubble Return the last non blank cell in a row or column with formula

If you want to return the last non blank cell value, here is another formula can do you a favor.

1. Type this formula =LOOKUP(2,1/(A1:A13<>""),A1:A13) into a blank cell besides your data, see screenshot:

doc-return-first-data-cell-1

2. Then press Enter key, the last non blank cell value will be extracted at once. See screenshot:

doc-return-first-data-cell-1

Notes:

1. In the above formula, A1:A13 is the column range that you want to use, you can change it to your need. This formula also can be applied to get the last non blank cell value in a row, you just need to change the column range to row range.

2. The above formula just work correctly on single row or single column.


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Guest · 1 months ago
    A1:A13<>0 returns an array of value that are either true or false
    all values that are not 0 (eg <>0) in A1:A13 become true, and all else become false
    So now you can look up the first 'true' in that array and use it to index
  • To post as a guest, your comment is unpublished.
    Matt · 1 months ago
    What does "INDEX((A1:A13<>0)" mean? The first parameter to INDEX is the set of cells A1 through A13 but with a test for not equal to zero appended. I can't find any explanation of this.
  • To post as a guest, your comment is unpublished.
    guest · 2 months ago
    Hi can someone helpme on this,

    I have a csv file or maybe a excel which has n number of data's in it from which i need few collective data's using formulas which should be automatic,and i need the output to be in a table form.can please anyone helpme on this??
  • To post as a guest, your comment is unpublished.
    RaRdEvA · 3 months ago
    I would really love to know why ,1/([RANGE]<>0) works :(
  • To post as a guest, your comment is unpublished.
    Taufiq · 5 months ago
    How To Return The Last Non Blank Cell from some selected cells In A Row