John Caines
Well-known Member
- Joined
- Aug 28, 2006
- Messages
- 1,155
- Office Version
- 2019
- Platform
- Windows
Hello All.
I'm wanting to display the last cell in a range.
Basically it's a running total of £'s.
Column is W24:W274
As an example,, it goes something like this;
£100
£102
£99
£154
£111
etc, etc
And it's just whatever the last value displayed is the required value (That will be depicked into another cell via a formula).
I have googled etc,,, but there seems to be quite a few ways to do it, some work, some don't,,,
And I just really wanted a bit of clarity as to what was the best 1 to use (If there is such a thing,, IE best,,, maybe what I mean is the best as in simplest code, or purist excel code).
I found a formula here;
http://www.techonthenet.com/excel/questions/last_value.php
I couldn't get this to work,, but it seemed a bit long to be honest.
I found something here;
http://www.cpearson.com/excel/LastCell.aspx
Again, this didn't work,, keeps coming up with not valid in a merged cell,,, but this range now isn't merged? (But above 24,, W4:W22 some cells are merged), so maybe this is the problem?
Managed to get 3 to work,
http://help.lockergnome.com/office/cell-row-range-result--ftopict960544.html
Not sure which of these 3 is best to use?
Could someone just advise me what is best, or if there is a better alternative please.
Many thanks
John Caines
I'm wanting to display the last cell in a range.
Basically it's a running total of £'s.
Column is W24:W274
As an example,, it goes something like this;
£100
£102
£99
£154
£111
etc, etc
And it's just whatever the last value displayed is the required value (That will be depicked into another cell via a formula).
I have googled etc,,, but there seems to be quite a few ways to do it, some work, some don't,,,
And I just really wanted a bit of clarity as to what was the best 1 to use (If there is such a thing,, IE best,,, maybe what I mean is the best as in simplest code, or purist excel code).
I found a formula here;
http://www.techonthenet.com/excel/questions/last_value.php
Code:
=INDEX(W24:X274,MAX(MATCH(9.99999999999999E+307,W24:X274),MATCH(REPT("z",255),W24:X274)))
I found something here;
http://www.cpearson.com/excel/LastCell.aspx
Code:
=MAX(ROW(W24:W274)*(W24:W274<>""))
Managed to get 3 to work,
http://help.lockergnome.com/office/cell-row-range-result--ftopict960544.html
Code:
=LOOKUP(9.9999999999999E+307,W24:W274)
Code:
=INDEX($W24:W274,COUNTA($W24:W274))
Code:
=LOOKUP(2,1/($W24:W274<>""),$W24:W274)
Could someone just advise me what is best, or if there is a better alternative please.
Many thanks
John Caines