SUM function

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
 
M

Mike H

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
 
R

Rick Rothstein \(MVP - VB\)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top