+ Reply to Thread
Results 1 to 8 of 8

How to get row number of last non blank cell in range?

  1. #1
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    680

    How to get row number of last non blank cell in range?

    For example, I want to return last row number of non blank cells in a column, then return the value in cell. Example, I want to check last row number of range A11:A (from row 11 and below), then return last row number in cell A1 (same column), there are blank cells in A2:A10, but I only want to know the last row of non blank cell in column A.

    I expect to return 16 to cell A1 for attached screenshot

    I look for range A11:A , not sure how many cells below A11.
    Or look into range A11:A1048576, then returns row number of last non empty cell.
    Attached Images Attached Images
    Last edited by VAer; 03-19-2024 at 10:10 AM.

  2. #2
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: How to get row number of last non blank cell in range?

    Try this in A1.
    Please Login or Register  to view this content.

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,749

    Re: How to get row number of last non blank cell in range?

    EDIT - IGNORE @windknife provided a better solution


    are you looking in range A11:A16 or A2:A16 - al little confused

    anyway
    =MATCH(2, 1/(A2:A100<>""))+1

    the +1 is because it will provide a number based on the range
    so as it starts at A2 - it will return 15 - so add1

    same if you start the range at A11
    =MATCH(2, 1/(A11:A18<>""))+10
    you need to add 10
    Attached Files Attached Files
    Last edited by etaf; 03-19-2024 at 10:10 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    680

    Re: How to get row number of last non blank cell in range?

    Quote Originally Posted by etaf View Post
    are you looking in range A11:A16 or A2:A16 - al little confused

    anyway
    =MATCH(2, 1/(A2:A100<>""))+1

    the +1 is because it will provide a number based on the range
    so as it starts at A2 - it will return 15 - so add1

    same if you start the range at A11
    =MATCH(2, 1/(A11:A18<>""))+10
    you need to add 10
    I look into range A11:A , not sure how many cells below A11.
    Or look into range A11:A1048576, then returns row number of last non empty cell. for screenshot, it should return 16
    Last edited by VAer; 03-19-2024 at 10:13 AM.

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: How to get row number of last non blank cell in range?

    here's mine... =ADDRESS(MATCH(9.99999999999E+307,A:A),1,4,1)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  6. #6
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    680

    Re: How to get row number of last non blank cell in range?

    Quote Originally Posted by etaf View Post
    EDIT - IGNORE @windknife provided a better solution


    are you looking in range A11:A16 or A2:A16 - al little confused

    anyway
    =MATCH(2, 1/(A2:A100<>""))+1

    the +1 is because it will provide a number based on the range
    so as it starts at A2 - it will return 15 - so add1

    same if you start the range at A11
    =MATCH(2, 1/(A11:A18<>""))+10
    you need to add 10
    Thanks much.

  7. #7
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: How to get row number of last non blank cell in range?

    Another way,

    =LOOKUP(2,1/(A:A<>""),ROW(A:A))

  8. #8
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: How to get row number of last non blank cell in range?

    Some other ways.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Leave cell blank if a range is blank
    By Dibbley247 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-10-2014, 06:30 AM
  2. Replies: 2
    Last Post: 11-22-2013, 01:07 PM
  3. Using last row number as range - cut rows with blank cells
    By RiskyP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-05-2013, 07:24 AM
  4. [SOLVED] This sum minus the last number in the range of cells (that isn't blank)?
    By ThomasCarter in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-30-2012, 12:57 PM
  5. [SOLVED] Use VBA to populate Progressive Number in blank cell if a corresponding cell is not blank
    By davegscott in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-05-2012, 09:40 AM
  6. Count number of non-blank cells in a range
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-15-2011, 10:15 PM
  7. If number (Combo! Formula) If blank Cell Blank...
    By Zees in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 09-27-2010, 01:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1