Adding last three entries

B

Biff

Hi Mike,

Here's one way - adjust ranges as needed:

=SUM(OFFSET(A1,COUNTA(A:A),0,-4))

Biff
 
M

Myrna Larson

Just wanted to point out that the formula requires that there be no embedded blank cells in
column A.
 
A

Anon

Assume, for example, that there are 5 entries in column A (i.e. A1:A5). The
start of the sum range is offset from A1 by 5 rows; that is, it is A6. So
the height needs to be -4 (i.e. sum range A6:A3) in order to add the last
three entries (A3:A5).
 
J

JMay

Thanks Anon for the explanation.
I better understand the Offset() function now.
I suppose as an alternative I would now enter the same formula as:

=SUM(OFFSET(A1,COUNTA(A:A)-1,0,-3)) << the set my orig row count
(movement down) to row 4 (from position A1), then bring back the 3 cell
range (to relate to the 3 rows I want) area in my Sum().. Right?

I wouldn't have understood this without your assistance, thanks again.
 
A

Anon

This is correct. Personally, I would write the formula as
=SUM(OFFSET(A1,COUNTA(A:A)-3,0,3))
as I find it easier to think of ranges in a 'forwards' direction (such as
A3:A5, rather than A5:A3).
However, all three versions give the same result, so it's just a matter of
personal preference.
 

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