# 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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

#### 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
103
Replies
6
Views
266
Replies
3
Views
54
Replies
4
Views
95
Replies
3
Views
96

1,172,163
Messages
5,879,396
Members
433,426
Latest member
Kypreos

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