# Using the 2 values from one column with Conditional Sum

#### moppy_j

##### New Member
Hi, i need help with a Conditional Sum. The below formula is working properly.

=SUM(IF(\$B\$5:\$B\$198="ESM",IF(\$K\$5:\$K\$198="China",IF(\$A\$5:\$A\$198="Forecast",\$P\$5:\$P\$198,0),0),0))

Whereby Column B= ESM, Column K is China, Column A is Forecast and Column P is the data to Sum.

What i need to do now is a sum whereby instead of adding the China cells, I add Hong Kong and Taiwan.

So, i think my problem is that it's trying to add cells whereby the value in K is both Hong Kong AND Taiwan, when i need to add cells where Column K = Hong Kong OR Taiwan.

Any thoughts about how i can add the OR syntax into this formula?

Thanks

Chris

Last edited:

### Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

#### Guanjin Peter

##### Active Member
have you tried sum product formula?

#### moppy_j

##### New Member
I am trying the sumproduct formula now but i'm not familiar with it.

So far i have managed this

=SUMPRODUCT((\$A\$4:\$A\$198="Forecast")*(\$B\$4:\$B\$198="ESM")*(\$K\$4:\$K\$198="Hong Kong")*(\$P\$4:\$P\$198))

But it hasn't worked.

Any ideas?

For simplicity reasons i am trying to do it for Hong Kong only at first

Thanks

#### moppy_j

##### New Member
I have managed to make this work with sumproduct, thanks

welcome.

Replies
0
Views
255
Replies
3
Views
191
Replies
4
Views
146
Replies
0
Views
344
Replies
6
Views
196

1,129,754
Messages
5,638,170
Members
417,011
Latest member

### 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.

### Which adblocker are you using?

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

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