vendredi 19 février 2016

If statement on each column and return corresponding Cell

I have 3 Columns, A,B, and C. A holds a value, B is a bool, C2 is Total. Let's say I have such values:

A   B   C
5   1   60
20  0    
40  0   

What I want for C2, is that it will check each A&B and sum up the values as in:

If B(number) = 1, return 0, else return A(number).

Then the numbers returned will be summed up and put into C.

What I tried was:

=SUM(IF( (B2:B999) = 1,0,A2:A999) )

But this is not giving me correct answers based on B, it just gives me A all the times, so it assumes B2:B999 is always 0.

How can I let Column C be the summation of A only if B is 1?

Thanks

Aucun commentaire:

Enregistrer un commentaire