SIGforum.com    Main Page  Hop To Forum Categories  The Lounge    Excel geniuses -- I need help using the last value in a column in a formula.
Go
New
Find
Notify
Tools
Reply
  
Excel geniuses -- I need help using the last value in a column in a formula. Login/Join 
Member
Picture of vthoky
posted
I should know how to do this already, but I'm evidently having a brain cramp this morning.

I've got a worksheet with five columns -- the first is column is dates and the next four are corresponding numbers. A row gets appended to those columns each time inventory is reviewed.

What I'm aiming to do is to put a formula somewhere below the last row that will use the last value in the fifth column as part of its calculation. I'm having trouble this morning telling Excel to find and use that "last-value-in-a-column."

What am I overlooking?

Thanks, all.




God bless America.
 
Posts: 14292 | Location: Virginia | Registered: July 15, 2007Reply With QuoteReport This Post
Member
Picture of sgalczyn
posted Hide Post
Try this:


https://exceljet.net/formula/g...-last-non-empty-cell
A broader description is there.



Generic formula

=LOOKUP(2,1/(range<>""),range)

Summary

To find the value of the last non-empty cell in a row or column, even when data may contain empty cells, you can use the LOOKUP function with an array operation. The formula in F6 is:

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

The result is the last value in column B. The data in B:B can contain empty cells (i.e. gaps) and does not need to be sorted.

Note: This is an array formula. But because LOOKUP can handle the array operation natively, the formula does not need to be entered with Control + Shift + Enter, even in older versions of Excel.


"No matter where you go - there you are"
 
Posts: 4695 | Location: Eastern PA-Berks/Lehigh Valley | Registered: January 03, 2001Reply With QuoteReport This Post
Member
Picture of vthoky
posted Hide Post
Twenty minutes from "asked" to "answered." I love this place for that.

Thank you, sgalczyn, that's exactly what I needed.




God bless America.
 
Posts: 14292 | Location: Virginia | Registered: July 15, 2007Reply With QuoteReport This Post
Member
Picture of sgalczyn
posted Hide Post
Sorry for the lag - was brewing some good coffee.............. Wink


"No matter where you go - there you are"
 
Posts: 4695 | Location: Eastern PA-Berks/Lehigh Valley | Registered: January 03, 2001Reply With QuoteReport This Post
Member
Picture of bigdeal
posted Hide Post
quote:
Originally posted by sgalczyn:
Sorry for the lag - was brewing some good coffee.............. Wink
Just asking, but wouldn't using =VLOOKUP be the preferred function? The result will likely be the same, but =VLOOKUP is the updated version of the =LOOKUP function.


-----------------------------
Guns are awesome because they shoot solid lead freedom. Every man should have several guns. And several dogs, because a man with a cat is a woman. Kurt Schlichter
 
Posts: 33845 | Location: Orlando, FL | Registered: April 30, 2006Reply With QuoteReport This Post
Member
Picture of sgalczyn
posted Hide Post
quote:
Just asking, but wouldn't using =VLOOKUP be the preferred function? The result will likely be the same, but =VLOOKUP is the updated version of the =LOOKUP function.

tomaaaayto....tomahhhto

This message has been edited. Last edited by: sgalczyn,


"No matter where you go - there you are"
 
Posts: 4695 | Location: Eastern PA-Berks/Lehigh Valley | Registered: January 03, 2001Reply With QuoteReport This Post
  Powered by Social Strata  
 

SIGforum.com    Main Page  Hop To Forum Categories  The Lounge    Excel geniuses -- I need help using the last value in a column in a formula.

© SIGforum 2024