sumifs help needed

smgomez

Board Regular
Joined
Nov 13, 2009
Messages
63
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

1605196679491.png


TOTAL WORKSHEET
AB
321654
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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.
 
Upvote 0
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
 
Upvote 0
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))
 
Upvote 0
Solution

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

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?

Disable AdBlock

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
Back
Top