Searching an array and finding sum

T

Tre_cool

I have a spread sheet with values in one column and a second column with
just "Yes" or 0 depending on if column A satisfied a criteria. I would
like to search through column B and find the sum of column A between
the "Yes" rows. For example I would like to find the sum of Column A
between line 1 and 4 and the sum between 4 and 6. It must work when the
"Yes"'s are in different lines as well.
EG.
line Col A Col B
1 3 Yes
2 6 0
3 8 0
4 11 Yes
5 12 0
6 16 Yes

Please help as I've been struggling with this for a little while.

Thanks in advance!
Trev
 
T

Tom Ogilvy

What do you mean by between. Is =Sum(A1:A4) included in the sum or is only
=Sum(A2:A3) for the first group.

Where do the results go?

Are the string "Yes" and the number zero (0) produced by a formula? Are the
formulas currently in the cells in column B?
 
T

Tre_cool

Tom,
It's the sum between the "Yes"'s, so =Sum(A2:A3). The formula
to generate the "Yes" and 0 are in the cells in Column B.


The results will just go in Column C. I hope that makes sense.

Thanks
Trevor
 
T

Tre_cool

Tom, this works!! However when there are multiple yes' it does not work
for example, in row 4 and 5. This is currently giving the same sum fo
both 4 and 5.

1 3 Yes
2 6 0
3 8 0
4 11 Yes
5 12 Yes
6 16 0
7 14 0
8 3 0
9 13 Yes
10 2 0

Thanks in advance

Trevo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top