If / And and a Sum If Formula?

Mississippi Girl

Board Regular
Joined
Oct 27, 2005
Messages
155
Hi - been going in circles with this formula for a while.
I have 2 data sets; one is the base value of services/commodities, etc. with associated fees calculated in Rows 13 and 14; the second data set contains the same data, but at the fully loaded value (with fees calculated on each item vs. at the end).

Fee 1 is applied to everything, no matter what. That's an easy one.
Fee 2 is only applied to Contract Labor and Contract Materials, but only when the sum of Contract Labor and Contract Materials (in cell range O3:O11) is $1M or higher.

Row 15 should equal Row 28.
Can you see what I'm doing wrong? In my mind, this makes perfect sense.
Thanks for your help!

Capture.JPG
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
The difference is that you don't have any Fee2 included in the second table calculations...which it should since O3:O11 is greater than $1M.
 
Upvote 0
Try something like this in D20: =if(and($A20="Contract*",sumifs($O$3:$O$11,$A$3:$A$11,"Contract*")>999999),D4+(D4*.0052)+(D4*.144),D4*1.144)
but without seeing the other formulas in your sheet it's difficult. Can you use the XL2BB add in from this site to share the range in your screenshot?

 
Upvote 0
Try something like this in D20: =if(and($A20="Contract*",sumifs($O$3:$O$11,$A$3:$A$11,"Contract*")>999999),D4+(D4*.0052)+(D4*.144),D4*1.144)
but without seeing the other formulas in your sheet it's difficult. Can you use the XL2BB add in from this site to share the range in your screenshot?

Stand by
 
Upvote 0

Mr Excel Help.xlsx
ABCDEFGHIJKLMNO
1Base Values
2ResourceCategoryPrior Funding ReceivedMar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23Prior Funding ReceivedFY23FY24Total This ActionNew Work Total
3Direct LaborLabor146,41858,89913,76020,29620,29620,29620,296146,418153,843-153,843300,261
4Contract LaborLabor322,983500,00014,72035,78835,78835,78835,788322,983657,872-657,872980,855
5Contract MaterialsMaterial251,71728,228251,71728,228-28,228279,945
6Commoditiy #1Commodities-----
7Commoditiy #2Commodities29,14829,148---29,148
8Commoditiy #3Commodities88,04188,041---88,041
9Commoditiy #4Commodities2,1822,1822,1822,1822,182-10,909-10,90910,909
10Commoditiy #5Commodities3,000-3,000-3,0003,000
11Commoditiy #6Commodities-----
12838,307558,89961,89058,26658,26658,26658,266-838,307853,852-853,8521,692,159
13FEE 1 - 14.4%120,71680,4818,9128,3908,3908,3908,390-120,716122,955-122,955243,671
14FEE 2 - 0.52%2,9882,600223186186186186-2,9883,568-3,5686,556
15962,012641,98171,02566,84266,84266,84266,842-962,012980,374-980,3741,942,386
16
17Fully Loaded Values
18ResourceCategoryPrior Funding ReceivedMar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23Prior Funding ReceivedFY23FY24Total This ActionNew Work Total
19Direct LaborLabor167,50267,38115,74123,21923,21923,21923,219-167,502175,996-175,996343,499
20Contract LaborLabor369,493572,00016,84040,94140,94140,94140,941-369,493752,606-752,6061,122,098
21Contract MaterialsMaterial287,964-32,293-----287,96432,293-32,293320,257
22Commoditiy #1Commodities-------------
23Commoditiy #2Commodities33,345-------33,345---33,345
24Commoditiy #3Commodities100,719-------100,719---100,719
25Commoditiy #4Commodities--2,4962,4962,4962,4962,496--12,480-12,48012,480
26Commoditiy #5Commodities--3,432------3,432-3,4323,432
27Commoditiy #6Commodities-------------
28959,023639,38170,80266,65666,65666,65666,656-959,023976,807-976,8071,935,830
29
30Delta:(2,988)(2,600)(223)(186)(186)(186)(186)
Sheet1
Cell Formulas
RangeFormula
K3:K15K3=+C3
L19:L28,L3:L15L3=SUM(D3:J3)
N3:N15N3=+M3+L3
O19:O28,O3:O15O3=SUM(K3:M3)
C12:J12,M12,C28:J28C12=SUM(C3:C11)
C13:J13C13=SUM(C3:C11)*14.4%
C14:J14C14=+IF(SUMIF($A$3:$A$11,"Contract*",$O$3:$O$11)>999999,SUMIF($A$3:A$11,"Contract*",C$3:C$11)*0.52%,0)
C15:J15C15=SUM(C12:C14)
M15M15=SUM(M13:M14)
C18:J18,M18:O18C18=+C2
K18:L18K18=K2
N19:N28N19=SUM(L19:M19)
C19:J27C19=IF(AND($A19="SACOM*",SUMIF($A$3:$A$11,"SACOM*",$O$3:$O$11)>999999),C3*0.52%+C3*1.144,C3*1.144)
K19:K28K19=SUM(C19)
C30:I30C30=+C28-C15
 
Upvote 0
Try changing this:
Excel Formula:
$A20="Contract*"

To either of these:
Excel Formula:
LEFT($A20,8)="Contract"
or
Excel Formula:
COUNTIFS($A20,"Contract*")
 
Upvote 0
Solution
It also looks like C19:J27 are looking for "SACOM*" rather than "CONTRACT*"...and as such, isn't adding the .52%
 
Upvote 0
In the real file, it's looking for SACOM; I made an edit for the upload and didn't capture that change. It still doesn't work though :(
Mr Excel Help.xlsx
ABCDEFGHIJKLMNO
1Base Values
2ResourceCategoryPrior Funding ReceivedMar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23Prior Funding ReceivedFY23FY24Total This ActionNew Work Total
3Direct LaborLabor146,41858,89913,76020,29620,29620,29620,296146,418153,843-153,843300,261
4Contract LaborLabor322,983500,00014,72035,78835,78835,78835,788322,983657,872-657,872980,855
5Contract MaterialsMaterial251,71728,228251,71728,228-28,228279,945
6Commoditiy #1Commodities-----
7Commoditiy #2Commodities29,14829,148---29,148
8Commoditiy #3Commodities88,04188,041---88,041
9Commoditiy #4Commodities2,1822,1822,1822,1822,182-10,909-10,90910,909
10Commoditiy #5Commodities3,000-3,000-3,0003,000
11Commoditiy #6Commodities-----
12838,307558,89961,89058,26658,26658,26658,266-838,307853,852-853,8521,692,159
13FEE 1 - 14.4%120,71680,4818,9128,3908,3908,3908,390-120,716122,955-122,955243,671
14FEE 2 - 0.52%2,9882,600223186186186186-2,9883,568-3,5686,556
15962,012641,98171,02566,84266,84266,84266,842-962,012980,374-980,3741,942,386
16
17Fully Loaded Values
18ResourceCategoryPrior Funding ReceivedMar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23Prior Funding ReceivedFY23FY24Total This ActionNew Work Total
19Direct LaborLabor167,50267,38115,74123,21923,21923,21923,219-167,502175,996-175,996343,499
20Contract LaborLabor369,493572,00016,84040,94140,94140,94140,941-369,493752,606-752,6061,122,098
21Contract MaterialsMaterial287,964-32,293-----287,96432,293-32,293320,257
22Commoditiy #1Commodities-------------
23Commoditiy #2Commodities33,345-------33,345---33,345
24Commoditiy #3Commodities100,719-------100,719---100,719
25Commoditiy #4Commodities--2,4962,4962,4962,4962,496--12,480-12,48012,480
26Commoditiy #5Commodities--3,432------3,432-3,4323,432
27Commoditiy #6Commodities-------------
28959,023639,38170,80266,65666,65666,65666,656-959,023976,807-976,8071,935,830
29
30Delta:(2,988)(2,600)(223)(186)(186)(186)(186)
Sheet1
Cell Formulas
RangeFormula
K3:K15K3=+C3
L19:L28,L3:L15L3=SUM(D3:J3)
N3:N15N3=+M3+L3
O19:O28,O3:O15O3=SUM(K3:M3)
C12:J12,M12,C28:J28C12=SUM(C3:C11)
C13:J13C13=SUM(C3:C11)*14.4%
C14:J14C14=+IF(SUMIF($A$3:$A$11,"Contract*",$O$3:$O$11)>999999,SUMIF($A$3:A$11,"Contract*",C$3:C$11)*0.52%,0)
C15:J15C15=SUM(C12:C14)
M15M15=SUM(M13:M14)
C18:J18,M18:O18C18=+C2
K18:L18K18=K2
N19:N28N19=SUM(L19:M19)
C19:J27C19=IF(AND($A19="Contract*",SUMIF($A$3:$A$11,"Contract*",$O$3:$O$11)>999999),C3*0.52%+C3*1.144,C3*1.144)
K19:K28K19=SUM(C19)
C30:I30C30=+C28-C15
 
Upvote 0
In the real file, it's looking for SACOM; I made an edit for the upload and didn't capture that change. It still doesn't work though :(
Did you try either of the suggestions in my Post #6 ?
Mind you for SACOM if you use left you would have to change the 8 to a 5.
 
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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