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 row number of first or last non blank cell in worksheet?

Have you ever tried to get or return the row number of the first or last non blank cell in a worksheet as following screenshot shown? This tutorial, I will talk about some formulas for you to solve this job in Excel.

Return or get the row number of first or last non blank cell with formulas


Return or get the row number of first or last non blank cell with formulas


The following formulas can help you to quickly calculate the row number of the first and last non blank cell, please do as this:

Return the row number of the first non blank cell:

Please enter this this formula: =ROW(INDEX(A2:A20,MATCH(TRUE,INDEX((A2:A20<>0),0),0))) into a blank cell where you want to get the row number, and then press Enter key, and the first non blank cell’ row number has been displayed as following screenshot shown:

Return the row number of the last non blank cell:

To get the row number of the last non blank cell, please apply this formula:

Enter the formula: =SUMPRODUCT(MAX((A2:A20<>"")*ROW(A2:A20))) into a blank cell to locate the calculated result, and then press Enter key to return the correct result, see screenshot:

Note: In the above formulas, A2:A20 is the range of cells that you want to use.



Excel Productivity Tools

Kutools for Excel - The Best Office Productivity Tool

  • Brings 300 powerful advanced features to Excel, enable you to do smarter, faster and better.
  • No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
  • Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds, 
  • Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
  • 110,000 highly effective people and 300+ world-renowned companies' choice.
  • 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.

Office Tab - brings tabbed interface to Office, make your work much easier.

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
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.
    juan miguelita · 1 years ago
    Hi! I would appreciate if you could also provide the formula for getting the row number of the second non-blank cell. Please help me.
    • To post as a guest, your comment is unpublished.
      skyyang · 1 years ago
      Hello,
      the following formula can help you to get all the row numbers of the non-blank cells, please try it, thank you!
      =IFERROR(ROW(INDEX($A$1:$A$12,SMALL(INDEX(NOT(ISBLANK($A$1:$A$12))*ROW($A$1:$A$12),0),COUNTBLANK($A$1:$A$12)+ROW(A1)))),"")
      • To post as a guest, your comment is unpublished.
        Michiel Van den Brande · 10 months ago
        Hello, i used the function above finding the row number in which the cell in the column is not blank.


        But, I used the function for a column which has a function itself and the analog function doesn't function. Anyone can help me please?