finding last row of data

kemperohlmeyer

Board Regular
Joined
Oct 4, 2006
Messages
73
What is the formula to tell excel to look for the last row of data (i.e. return data of stocks) and then use that as a reference point to calculate from?

ie, find last data point and use the previous three data points from there to calculate a qtr's return?

ko
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
This:

=INDEX(A:A,MATCH(9.99999999999999E+307,A:A))

will return a reference to the last non-empty cell in column A, assuming it contains numbers, and:

=SUM(OFFSET(INDEX(A:A,MATCH(9.99999999999999E+307,A:A)),-2,0,3,1))

will sum the last 3 entries.

In VBA this:

Code:
Dim Rng As Range
Set Rng = Range("A" & Rows.Count).End(xlUp)

will create a Range object that refers to the last non-empty cell in column A on the ActiveSheet.
 
Upvote 0

Forum statistics

Threads
1,215,067
Messages
6,122,949
Members
449,095
Latest member
nmaske

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