Display last value from a row or column?
iMac, OS X El Capitan (10.11)
OFFSET is a powerful but "volatile" function, meaning it recalculates when you so much as breathe on your spreadsheet, which can slow things down if you have a document of any size. (I'm exaggerating about the breathe part, but you get the idea). INDEX is less processing intensive, and in a case like this, simpler to use IF you don't have any blank cells among your values (blank cells after, of course, is no problem).
Here's OFFSET doing the same thing as INDEX in my post above ...
=OFFSET(B1,COUNTA(B),0)
No advantage to using it instead of INDEX in this case. But if you do have blanks among your values, Wayne's approach with OFFSET and an extra column will do the trick.
SG
Bruce Kieffer wrote:
Can the formula be modified to work on a range of cells in a column?
Yes, you can do something like this:
(The +1 in the original formula dealt with the Header Row).
However, you may not want to use a specific range. Referencing the entire column in a Numbers table means you don't have to worry about changing the formula if the number of rows in the body of your table expands; it's self-expanding).
SG
the only way I can come up with is to create a second column that marks entries. Then you can use the marker to locate that last item... like this:
In this example, enter the data in column B (just to match your input).
C2=IF(B2="", "", MAX($C$1:C1)+1)
this is shorthand for, select cell C2, then type (or copy and paste from here) the formula:
=IF(B2="", "", MAX($C$1:C1)+1)
select cell C2, copy
select cells C2 thru the end of column C, paste
cell E3 contains the value in the last cell of column B.
E3=OFFSET($B$1,MATCH(MAX(C), C)−1, 0)
I selected the method I did so that you could leave cells blank in the column. If you do not need this "feature" then SGs solution is preferable
Your =INDEX(B,COUNTA(B)+1) most likely will work for my needs since I think I will rarely if ever have a blank cell in the sequence. Can the formula be modified to work on a range of cells in a column?
I've seen a lot of folks use the =offset formula, but I'm having trouble figuring out how that works.
I appreciate that, and I plan to try your solution too so I can learn. Thanks for the help.
Display last value from a row or column?