# Thread: Conditional sum if Thanks:  3 Post #5316652 (1)Post #5316660 (1)Post #5316646 (1) Likes:  3 Post #5316660 (1)Post #5316646 (1)Post #5316652 (1)

1. ## Conditional sum if

Hi

Is there a way to sum one column only if the values in another column are populated?

So in the example below, there are 5 products: A - E in column A.

Column B states whether or not a product is 'Live'

And column C has the sales data for that product.

I'd like to sum up the sales of the products in column C only if there is a value in column B.

So the sum total would be 10 instead of 15.

Has anyone done this before? TIA

 Product Live? Sales A Yes 1 B Yes 2 C Yes 3 D Yes 4 E 5 15

2. ## Re: Conditional sum if

Simple SUMIF

=SUMIF(B:B,"Yes",C:C)

3. ## Re: Conditional sum if

I'm assuming that B may not always be blank or Yes? "Not blank" can be tricky in a SUMIF, so sum all and deduct the blanks:
=SUM(C1:C5)-SUMIF(B1:B5,"",C1:C5)

4. ## Re: Conditional sum if

Originally Posted by Trevor_S
I'm assuming that B may not always be blank or Yes? "Not blank" can be tricky in a SUMIF, so sum all and deduct the blanks:
=SUM(C1:C5)-SUMIF(B1:B5,"",C1:C5)

Why not use =SUMIF(B1:B5,"<>",C1:C5)

5. ## Re: Conditional sum if

Ok, thanks everyone.

The methods were useful!