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
 
Top