Formula issue

normpam

Active Member
Joined
Oct 30, 2002
Messages
355
The first part of my formula evaluates correctly to 115.54 : =SUMIFS(TimeHours,ProviderID,F5,ProcedureCode,"<>Staff Training",ProcedureCode,"<>Scheduled Time Off",Labels,"<>*Full Time*")

The second part of my formula, taken separately also works just fine, and evaluates to 45 : SUMIFS(TimeHours,ProviderID,F5,Labels,"<>*Full Time*",Dates,">="&Wk1Begin,Dates,"<="&Wk1End)-40

If I simply subtract the second part from the first, I should therefore get 70.54. But I don't. I only get -13.46!!

=SUMIFS(TimeHours,ProviderID,F5,ProcedureCode,"<>Staff Training",ProcedureCode,"<>Scheduled Time Off",Labels,"<>*Full Time*")-SUMIFS(TimeHours,ProviderID,F5,Labels,"<>*Full Time*",Dates,">="&Wk1Begin,Dates,"<="&Wk1End)-40

What am I missing?
Much thanks.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Your 2nd sumifs returns 85 before you subtract the 40, therefore your combined formula equates to =115.54 - 85 - 40 which by my reckoning should return -9.46
You either need to wrap your second formula in brackets, or add 40 rather than subtract it.
 
Upvote 0
Did you try putting your second part of formula in parenthesis?
 
Upvote 0
Your 2nd sumifs returns 85 before you subtract the 40, therefore your combined formula equates to =115.54 - 85 - 40 which by my reckoning should return -9.46
You either need to wrap your second formula in brackets, or add 40 rather than subtract it.
"If I only had a brain".... (sung to the tune of the scarecrow form Wizard of Oz)
Thanks. Haven't figured out where to put the extra parentheses, but the +40 works like a charm (my original number should have been 117.54)
 
Upvote 0
Did you try putting your second part of formula in parenthesis?
"If I only had a brain".... (sung to the tune of the scarecrow form Wizard of Oz)
Thanks. Haven't figured out where to put the extra parentheses, but the +40 works like a charm (my original number should have been 117.54)
 
Upvote 0
Glad to help & thanks for the feedback. The extra brackets would be
Excel Formula:
=SUMIFS(TimeHours,ProviderID,F5,ProcedureCode,"<>Staff Training",ProcedureCode,"<>Scheduled Time Off",Labels,"<>*Full Time*")-(SUMIFS(TimeHours,ProviderID,F5,Labels,"<>*Full Time*",Dates,">="&Wk1Begin,Dates,"<="&Wk1End)-40)
 
Upvote 0
Haven't figured out where to put the extra parentheses, but the +40 works like a charm (my original number should have been 117.54)
one at the beginning of your second formula and one at the end of your second formula.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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