SUM function

  • Thread starter Thread starter Margs
  • Start date Start date
M

Margs

I have a column where I enter a figure in a row once a day. I would like to
add up the last three rows only so that no matter how many numbers are
entered in the column I am only working with the last three entries.
I cannot find the answer in any of my books.
Many thanks
 
Hi,

This will throw an error if there are less than 3 rows. If that's a problem
post back.

=SUM(OFFSET(A1,COUNTA(A:A)-3,):OFFSET(A1,COUNTA(A:A),))

Mike

Mike
 
Provided there are at least 3 rows of data, and assuming the column we are
talking about is Column A...

=SUM(INDIRECT("A"&(MATCH(LOOKUP(2,1/(A1:A65535<>""),A:A),A:A,0)-2)&":A"&MATCH(LOOKUP(2,1/(A1:A65535<>""),A:A),A:A,0)))

If your column is different from Column A, then change all the A's above
(except for the one in the word MATCH<g>) to the column letter containing
your data.

Rick
 
Back
Top