How To Reference Last Row With Data In A Column?

Dhira

Board Regular
Joined
Feb 23, 2006
Messages
87
Office Version
  1. 2021
Platform
  1. Windows
How do I reference the most recent row number that had data?
Example:
Column C references data in column B
Column B's last data was on row 5
But Column C is now row 17 wants to use the data in Column B row 5 to calculate a formula.

How to reference that row number (i.e. 5; which will change sporadically every time data is entered in Column B)?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Easily do-able with a VBA solution. Not sure how to do so with a formula.
 
Upvote 0
Depending on what calculation, there might be a solution. Can you provide an example?
 
Upvote 0
Assuming you have values in column B. This will return the last value in the column. As Cubist states above it would help to see an example .
The lookup value in the MATCH function needs to be greater than the largest value in column B.

Book1
ABCD
1Data6
22
34
45
56
6
Sheet1
Cell Formulas
RangeFormula
D1D1=INDEX(B:B,MATCH(999999999999,B:B))
 
Upvote 0
=INDEX(B:B,MATCH(999999999999,B:B))
Thank you, this is almost it.

What I now need is to somehow be able to show/reference the ROW of the last value (In your example, ROW 5).
How to extract the row is the question.

I'll see if I can put up an example.
 
Upvote 0
Just wrap it in a Row function

Book1
ABCD
1Data5
22
34
45
56
Sheet2
Cell Formulas
RangeFormula
D1D1=ROW(INDEX(B:B,MATCH(999999999999,B:B)))
 
Upvote 0
Just wrap it in a Row function

Book1
ABCD
1Data5
22
34
45
56
Sheet2
Cell Formulas
RangeFormula
D1D1=ROW(INDEX(B:B,MATCH(999999999999,B:B)))
Awesome, sir.

I now have almost what I need.
I used your formula to show the row, but ultimately, the reason i wanted the row of 'last data' was so i could use it in a formula to calculate (multiplying it with a percentage).
However, I can't seem to concoct a formula to show that row (of last data) and multiply it by the column.

I managed to give an example below:

Data.xlsx
ABCDE
1(Last) Data"%"Last Data RowLast Data x "%" Column
22100%22
3475%33
4555%42.75
5671%54.26
666%53.96
7687%75.22
895%75.7
935%72.1
10455%102.2
1171%102.84
1266%102.64
1387%103.48
Sheet3
Cell Formulas
RangeFormula
D2:D13D2=ROW(INDEX(B$1:B2,MATCH(9999999,B$1:B2)))
E10,E7,E2:E5E2=B2*C2
E6,E11,E8E6=B5*C6
E9,E12E9=B7*C9
E13E13=B10*C13


The question is then this:
Now that I have the row with the last data, how do I combine it with a column in order to reference it yet again in 'Column E above (which I changed manually to show the desired result, but I need a formula that calculates it)?
 
Upvote 0
Book1
ABCDE
1(Last) Data"%"Last Data x "%"
22100%2
3475%3
4555%2.75
5671%4.26
666%3.96
7687%5.22
895%5.7
935%2.1
10455%2.2
1171%2.84
1266%2.64
1387%3.48
Sheet10
Cell Formulas
RangeFormula
E2:E13E2=LOOKUP(2,1/($B$2:B2<>""),$B$2:B2)*C2
Thanks so much @Cubist. This is the exact answer I asked for.

I actually needed this for a larger formula I'm workign on, but I wanna give you credit for this, so I'm gonna mark it as complete.

If you get a chance, could you look at my question in this thread? It builds on this one and is the final solution I need.

Thanks again.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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