View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default SUM Range Between Zeros

Here you go....

NON-array formula
A6: =SUM(INDEX(A2:A5,MAX(INDEX((A2:A5=0)*ROW(A2:A5),0) )):A5)

or...the ARRAY FORMULA version
(committed with ctrl+shift+enter, instead of enter)
A6: =SUM(INDEX(A2:A5,MAX((A2:A5=0)*ROW(A2:A5))):A5)

OR....if there may be blank values.....
NON-array formula
A6: =SUM(INDEX(A2:A5,MAX(INDEX(ISNUMBER(A2:A5)*(A2:A5= 0)*ROW(A2:A5),0))):A5)

ARRAY FORMULA
A6: =SUM(INDEX(A2:A5,MAX(ISNUMBER(A2:A5)*(A2:A5=0)*ROW (A2:A5))):A5)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Exceller" wrote:

Greetings Excel Gurus,

I've searched the knowlege base for a formula to solve my issue, but have
found nothing.

Here's an illustration (where "A" is the column and numbers 1-6 downward are
rows):

A
1 <header
2 5
3 0
4 15
5 20
6 <formula

The formula in A6 would sum cells A4 and A5 (all values 0 between the
formula and first cell upward that contains a zero (wouldn't include cell
A2).

Thanks for your help!