# sumifs help needed

#### smgomez

##### New Member
I have the following formula that is not working. Here is what I want the formula to do in cell B2 of the total worksheet: sum columns H-K from the sub worksheet where the sum of columns F and G <0 where the value in sub worksheet column A matches the value in column A in the total worksheet. The values in column A on both worksheets is an employee number and there are many instances of the same value

=SUMIFS(Sub!H\$2:Sub!K\$2,Sub!A\$2:Sub!A\$904,A2,Sub!F\$2:Sub!G\$2,"<0")

SUB WORKSHEET

TOTAL WORKSHEET
 A B 321654

### Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

#### Eric W

##### MrExcel MVP
Try:

=SUMPRODUCT(Sub!\$H\$2:\$K\$904*(Sub!\$A\$2:\$A\$904=A1)*(Sub!\$F\$2:\$F\$904+Sub!\$G\$2:\$G\$904<0))

Adjusting the ranges as necessary.

#### smgomez

##### New Member
Thank you for the formula, I think we are close. The value I get with this formula is zero, I should get \$710.02. I also changed =A1 to =A2

#### Eric W

##### MrExcel MVP
With the Sub sheet like this:

Book1
ABCDEFGHIJK
232165400710.02000
33216541299221
Sub

I get this on the Total sheet:

Book1
AB
1
23216540
Total
Cell Formulas
RangeFormula
B2B2=SUMPRODUCT(Sub!\$H\$2:\$K\$20*(Sub!\$A\$2:\$A\$20=A2)*(Sub!\$F\$2:\$F\$20+Sub!\$G\$2:\$G\$20<0))

The way you explained it, and with your example, I'd expect a value of zero. Do you mean that you want to sum the values if the sum of the F:G columns is less than OR EQUAL to 0? If so, change the formula to:

Rich (BB code):
=SUMPRODUCT(Sub!\$H\$2:\$K\$20*(Sub!\$A\$2:\$A\$20=A2)*(Sub!\$F\$2:\$F\$20+Sub!\$G\$2:\$G\$20<=0))

#### smgomez

##### New Member
=SUMPRODUCT(Sub!\$H\$2:\$K\$20*(Sub!\$A\$2:\$A\$20=A2)*(Sub!\$F\$2:\$F\$20+Sub!\$G\$2:\$G\$20<=0))
OMG, I really missed that. Works perfectly. Thank you!

#### Eric W

##### MrExcel MVP
Happy to help! Thanks for the feedback.

Replies
9
Views
125
Replies
4
Views
68
Replies
4
Views
173
Replies
4
Views
68
Replies
1
Views
80

1,127,482
Messages
5,625,021
Members
416,065
Latest member
meiravmeron

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