+ Reply to Thread
Results 1 to 8 of 8

Formula to find value in last cell in column with numerical data NOT a formula

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Panama City, FL
    MS-Off Ver
    Excel 2016
    Posts
    175

    Formula to find value in last cell in column with numerical data NOT a formula

    Hello friends,

    I use
    Please Login or Register  to view this content.
    to find the value in the last cell of column B.
    Instead of manually entering data in the column I want to use a formula to retrieve it,
    Please Login or Register  to view this content.
    ,
    so I copy the formula down 100 rows. The cell only displays a BLANK CELL until it finds data.
    <the formula in the following row would look at $G$7 and so on. I'm having to manually update each row number because they do not increase as I drag them down because they are surrounded by quotes>

    The Formula-A above no longer works because it sees the Formula-B in the cells and includes them in the search for the last, so it lists the BLANK from cell B100.

    If it's possible, how can I make FORMULA-A only consider the cells with a numerical value and ignore the BLANKS (which are formulas)? The cells with numerical values are consecutive.

    Thanks!

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,942

    Re: Formula to find value in last cell in column with numerical data NOT a formula

    Enter using Ctrl-Shift-Enter: This will find the last value in column B that is not "" - it could be anything:

    =IFERROR(INDEX($B$1:$B$1000,MAX(IF($B$1:$B$1000<>"",ROW($B$1:$B$1000)))),"")

    To return the last number, again, with C-S-E:

    =IFERROR(INDEX($B$1:$B$1000,MAX(IF(ISNUMBER($B$1:$B$1000),ROW($B$1:$B$1000)))),"")
    Last edited by Bernie Deitrick; 04-23-2019 at 04:37 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Formula to find value in last cell in column with numerical data NOT a formula

    The following formula will return the last numerical value form column B:

    =LOOKUP(2^1023,$B:$B)

  4. #4
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Panama City, FL
    MS-Off Ver
    Excel 2016
    Posts
    175

    Re: Formula to find value in last cell in column with numerical data NOT a formula

    Works perfectly, thanks Bernie.
    I have no idea why the next response from Root_ has the same result, so simply.

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Formula to find value in last cell in column with numerical data NOT a formula

    LOOKUP, using Binary Search, finds last value <= criteria -- it assumes data to be sorted (regardless of reality), and will ignore data types that differ to the data type of the criteria.

    so, in _Roots suggestion:

    - criteria is numeric type (strings {incl. null} are ignored)
    - the criteria is big (bigger than any value in your dataset)

    LOOKUP thus returns last numeric value from your range as it deems this to be the biggest (assumes sorted), and still <= criteria.

    similar approach can be used with Text (to a point) - e.g.

    =LOOKUP(REPT("Z",255),$B:$B)

    would return last text string (but this would include null strings) -- note the 255 char limitation

    there are then variants to handle non-blanks/nulls

    =LOOKUP(2,1/($B:$B<>""),$B:$B)

    but the above is more expensive, computationally speaking, than the others.
    Last edited by XLent; 04-24-2019 at 04:15 AM.

  6. #6
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Panama City, FL
    MS-Off Ver
    Excel 2016
    Posts
    175

    Re: Formula to find value in last cell in column with numerical data NOT a formula

    Incredible -- thanks for the clear explanation! I love learning new stuff.

  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,638

    Re: Formula to find value in last cell in column with numerical data NOT a formula

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    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.

  8. #8
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Panama City, FL
    MS-Off Ver
    Excel 2016
    Posts
    175

    Re: Formula to find value in last cell in column with numerical data NOT a formula

    Thanks for the reminder AliGW . . . have a great day (or evening).

+ 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. [SOLVED] Find first empty cell and fill in formula too the last row of data in another column
    By fireguy7 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2018, 05:51 PM
  2. [SOLVED] Amend formula to find data in new shifted cell when original cell column is deleted
    By Learner_Mike in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-15-2018, 08:22 AM
  3. [SOLVED] Formula Index Column to find first blank cell and sum cells in different Column
    By Hood in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-18-2017, 07:57 PM
  4. Formula to find last non-blank, numerical cell in a row
    By thebyrddog in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-07-2013, 02:40 PM
  5. Text in cell before numerical data entered and applied to formula
    By blowfli in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-31-2013, 04:11 AM
  6. [SOLVED] Find Row Number of First Cell in Column Containing a Numerical Value
    By TStone1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-07-2013, 01:24 PM
  7. Macro to change numerical entries in last column to a sum formula
    By jbyrne in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-18-2010, 09:06 AM

Tags for this Thread

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