+ Reply to Thread
Results 1 to 9 of 9

How to find the last row number with formula?

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    How to find the last row number with formula?

    Hello

    In column A there is a list which may increase or decrease.Is it possible to find the refference of the last empty row with formula just like the vba
    iRow=cells(rows.count,columnindex).end(xlup).row

    Best Regards
    Imran Bhatti
    Teach me Excel VBA

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: How to find the last row number with formula?

    Yes, it is. Look at these:

    =LOOKUP(2,1/(A2:A10<>0),A2:A10)

    or:

    =LOOKUP(2,1/(A2:A10<>""),A2:A10)

    or for text:

    =LOOKUP(REPT("z",255),A2:A10)

    and for numbers:

    =LOOKUP(9.99999999999999E+307,A2:A10)

    You can change the ranges to suit.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: How to find the last row number with formula?

    Try this...

    Find text:

    =MATCH("zzzzz",A:A)

    Find number:

    =MATCH(10^307,A:A)

  4. #4
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: How to find the last row number with formula?

    @Phuocam
    =MATCH("zzzzz",A:A)
    This working even with blanks.Just we need to be careful while entering the meaningless text like"zzzz" as if this one exists in the range then it will destroy the formula.Any way it is Brilliant.

    @Ali

    Your formula is returning the value or text of the last row.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: How to find the last row number with formula?

    Quote Originally Posted by ImranBhatti View Post
    @Ali

    Your formula is returning the value or text of the last row.
    Isn't that what you asked for?

    As I said, change the ranges to suit. Use A:A, for example, instead of a specifically defined range.

  6. #6
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: How to find the last row number with formula?

    I was after finding the last row number like A7 A300 etc.
    Your formula is worth commendable where someone would like to return the value of the last cell.
    I also saved it in my formula sheet for future reference

    Thanks for your solution too.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: How to find the last row number with formula?

    Ah, I see. In that case, try this:

    =ROW(LOOKUP(2,1/(A2:A10<>0),A2:A10))

  8. #8
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: How to find the last row number with formula?

    I think a part of the formula is not copied here. formula does not leave the edit mode and says
    there is problem with this formula
    type
    1+1 cell shows 2


    etc

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: How to find the last row number with formula?

    Well, never mind - you have a solution from Phuocam.

+ 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. Formula to find out number per 100
    By ExcelNub in forum Excel General
    Replies: 6
    Last Post: 05-27-2021, 12:19 AM
  2. Replies: 1
    Last Post: 10-07-2016, 02:16 PM
  3. formula to find a number
    By mindymaddox in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-22-2013, 10:26 AM
  4. Excel 2007 : Find a specific number on a formula
    By mifzal.mufthi in forum Excel General
    Replies: 6
    Last Post: 04-26-2012, 03:01 AM
  5. Replies: 4
    Last Post: 02-26-2012, 02:38 AM
  6. Formula to find any number between two numbers?
    By bgo1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-07-2007, 10:12 AM
  7. Replies: 3
    Last Post: 07-07-2006, 09:10 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