Conditional sum if

Mr2017

Well-known Member
Joined
Nov 28, 2016
Messages
644
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
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

[TABLE="width: 202"]
<colgroup><col span="2"><col></colgroup><tbody>[TR]
[TD]Product [/TD]
[TD]Live? [/TD]
[TD]Sales[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Yes[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]Yes[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]Yes[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]Yes[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]E[/TD]
[TD] [/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]15[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
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)
 
Last edited:
Upvote 0
Ok, thanks everyone.

The methods were useful!
 
Upvote 0

Forum statistics

Threads
1,224,862
Messages
6,181,461
Members
453,043
Latest member
Sronquest

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top