# Using SUMIF to divide 2 cells

#### Dirkelton

##### New Member
Can anyone help. I'm trying I'm trying to divide 2 columns by each other if another column equals X

For example if column A equals 10, then divide the total of Column B agaisnt the total of column C.

I've tried extending the SUMIF formula in a number of ways (example below) but had no joy.

=sumif(A2:A10,="10",(sum(B2:B10))/(sum(c2:c10)))

### Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

#### barry houdini

##### MrExcel MVP
Do you mean

=SUMIF(A2:A10,10,B2:B10)/SUMIF(A2:A10,10,C2:C10)

#### Dirkelton

##### New Member
So simple, I tried numerous other combos but that. Reckon I need to go home.

Thanks Barry

#### energman58

##### Well-known Member
=SUMPRODUCT(--(U4:U8=10),(V4:V8))*SUMPRODUCT(--(U4:U8=10),(W4:W8))

Sums the total values in column V and in column W for those rows where column U = 10 and then multiplies them together. Is this what you were trying to do?

Alternatively

=SUMPRODUCT(--(U4:U8=10),(V4:V8)^-1,(W4:W8))

Divides each value in W by the corresponding value in V and adds those up where U = 10

Couldnt understand what you are driving at but I guess it must be one of these two

Replies
1
Views
101
Replies
6
Views
265
Replies
3
Views
50
Replies
4
Views
95
Replies
3
Views
95

1,172,040
Messages
5,878,855
Members
433,380
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.
Allow Ads at MrExcel

### Which adblocker are you using?

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