last item in a column

Caius

New Member
Joined
Apr 14, 2004
Messages
10
Hi there, it's me again, Excel n00b.

Just wondering if there's a formula for retrieving the last item in a column and then storing that value into another cell?

:p
 
yup. like this...
Book3.xls
ABCD
123
25
36
410
53
69
73
84
Sheet5


formula is:

=INDEX(A:A,MATCH(9.9999999E+307,A:A)-1)

key is the -1.

hth
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Here's a challege, what if the data is horizontal instead of vertical? I used =HLOOKUP(9.99999999E+307,2:2,1) for the last item, but the -1 doesn't work in this situation.
 
Upvote 0
firefytr, would your solution work if the cell above was blank.

Is there any chance of that?

This was my effort - probably over kill
Book1
BCDE
1Numbers
25
37lastvalue6
42ndlast9
54
68
79
8
9
106
Sheet1
 
Upvote 0
njws said:
Here's a challege, what if the data is horizontal instead of vertical? I used =HLOOKUP(9.99999999E+307,2:2,1) for the last item, but the -1 doesn't work in this situation.

Try,

=LOOKUP(9.9999999999999E+307,2:2)-1
 
Upvote 0
That one (=LOOKUP(9.9999999999999E+307,2:2)-1) takes the last value and subtracts one.
 
Upvote 0
GorD is right, as an alternative to his wonderful solution...
Book3.xls
BCDE
1Numbers
26
37lastvalue4
42ndlast7
54w/oOFFSET7
68
79
87
9
104
Sheet5


formula is:

=INDEX(B:B,MATCH(9.9999999999E+307,INDIRECT("b1:b"&MATCH(9.99999999E+307,B:B)-1)))

i just hate that OFFSET :devilish:
 
Upvote 0
njws said:
Using firefytr's formula is there a way to return the second to last value? I'm specifically interested in the numeric version.

Ultimate goal: Return the last value, the second to last value, and the change between the two.

Activate Insert|Name|Define.
Enter BigNum as name in the Names in Workbook box.
Enter the following uncrippled big number in the Refers to box:

9.99999999999999E+307

Click OK.

The following gives you the last numeric value in a range, referred to as Range...

=LOOKUP(BigNum,Range)

Range can be horizontal or vertical and definite like A2:A10 or B2:F2 or indefinite like A:A or 3:3.

The following will give you second last numeric value:

=LOOKUP(BigNum,INDEX(Range,MATCH(BigNum,Range)-1))
 
Upvote 0
Aladin, how would you tackle this if data contains blanks - any different?
 
Upvote 0

Forum statistics

Threads
1,215,299
Messages
6,124,132
Members
449,143
Latest member
LightArisen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top