Conditional Sum

P

Pat

I would like help on a function to sum the last five entries in a column.

Any help or thoughts that can be shared will be greatly appreciated.
 
P

Peo Sjoblom

One way

=IF(COUNT(A:A)<5,SUM(A:A),SUM(OFFSET($A$1,MATCH(9.99999999999999E+307,A:A)-1
,,-5,)))

for column A

Regards,

Peo Sjoblom
 
P

Pat

Sorry, I guess it would be helpful to state that some of the cells in the
column may be blanks.

Pat
 
P

Peo Sjoblom

Yes it would, try this instead

=SUM(A1000:INDEX(A:A,LARGE(IF(A1:A1000<>"",ROW(A1:A1000)),5)))

entered with ctrl + shift & enter

Regards,

Peo Sjoblom
 

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