View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default How to summarize the first 4 numbers greater than 0 from a list.

One way, assume your data starts in A1 going down to A26

=SUM(TRANSPOSE(OFFSET(A1,SMALL(IF((A1:A260),ROW(A 1:A26)),{1,2,3,4})-1,,ROWS(A1:A26),)))

entered with ctrl + shift & enter

--
Regards,

Peo Sjoblom

(No private emails please)


"Antonio" wrote in message
...
I've a list of numbers, I need to summarize the first 4 greater than zero
cronologically eventhough they were in different places, and it could
happen
only three or less were in the whole list.
Ex.
2 0 0 0 8 -3 -5 0 4 0 0 0 3 0 0 0 0 7 8 9 4 5 1 2 -8 -7

Sum. 2 + 8 + 4 + 3 = 17

easy hu? Thanks