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


Thanks Domenic but the values are getting are incorrect, let me attach part
of the table I'm working on.
Cat# A B C D E F G H Total
AF40 -20 20 0 10 -10 0 10 10 50
AF50 10 0 0 -60 0 -40 0 10 20
AF60 0 0 0 0 0 20 20 10 50
RT50 10 20 40 10 50 90 50 10 80
RT60 0 0 0 -50 0 -30 0 0 0
V100 20 20 0 0 0 -10 40 60 140

I hope this can help you better, thanks again!!
Antonio



"Domenic" wrote:

Try...

=SUM(SUBTOTAL(9,OFFSET(A1:A100,SMALL(IF(A1:A1000, ROW(A1:A100)-ROW(A1)),{
1,2,3,4}),0,1)))

....confirmed with CONTROL+SHIFT+ENTER, not just ENTER. Adjust the range
accordingly.

Hope this helps!

In article ,
"Antonio" wrote:

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