View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ashish Mathur[_2_] Ashish Mathur[_2_] is offline
external usenet poster
 
Posts: 1,766
Default Sum the last 21 cells

Hi,

You can also try this. Say you have 101-103 in A6:A8 and then 104-105 in
A11-A12. In cell B6, use =COUNTA($A$6:$A$12)-COUNT($A$5:A5) and copy down
till B12. In cell B15, use =SUMPRODUCT((B6:B12<=4)*(A6:A12)) to sum the
last 4 numbers

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"David" wrote in message
...
Hi

I am after the formula that will allow me to sum the values of the last 21
cells in a column that have a value. As some cells are blank, at times the
formula will have to count back more than 21 cells, sometimes only 21.

Is there a way other than manully changing the sum formula to increase the
range of cells covered whenever a blank cell occurs?

Thanks