# 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

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

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

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,168,018
Messages
5,856,840
Members
431,836
Latest member
jj0911

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