Nested IF Formula help

bburke73

New Member
Joined
Mar 6, 2022
Messages
4
I want col F to calculate the reallocation of excess demand quantities shown in Col E to the suppliers who can take additional demand. But that reallocation must not exceed the max supplier capacity shown in Col C. And the SUM quantities in Col B must match the revised demand quantities SUM in Col F.

Best I can tell, I need a second IF statement to account for the multiple conditions I’m facing, but am struggling to put the formula construction together.

Col ACol BCol CCol DCol ECol F
Row 1Original Business ShareOriginal Demand (QTY) AllocationSupplier's CapacitySupplier’s Remaining CapacityExcess demandRevised Demand (QTY) AllocationRevised Demand allocation current formula in use
Row 2Supplier A17%1,6843,0001,316-1,967=IF(B5<C5,B5+(E$6/2),B5)
Row 3Supplier B21%2,0512,000(51)512,000
Row 4Supplier C23%2,2502,500250-2,533
Row 4Supplier D17%1,7501,500(250)2501,500
Row 5Supplier E23%2,2652,000(265)2652,000
Row 6SUM LINE 10,00011,000-56610,000
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi
Welcome to MrExcel.

Can you some expected results, I am not getting what you want to achieve
 
Upvote 0
On what basis are you calculating the revised qty for those suppliers with excess capacity?
 
Upvote 0
Hi,

Your sample result in F4 can not be correct, you have 2533 as revised allocation, but the Max capacity for that supplier is 2500 in C4.

See if this works for you:

Book3.xlsx
ABCDEF
1Original Business ShareOriginal Demand (QTY) AllocationSupplier's CapacitySupplier’s Remaining CapacityExcess demandRevised Demand (QTY) Allocation
217%1,6843,0001,316-2,160
321%2,0512,000-51512,000
423%2,2502,500250-2,340
517%1,7501,500-2502501,500
623%2,2652,000-2652652,000
710,00011,000-56610,000
Sheet1041
Cell Formulas
RangeFormula
F2:F6F2=ROUND(MIN(C2,D2/SUMIF(D$2:D$6,">0",D$2:D$6)*E$7+B2),0)
 
Upvote 0
Solution
Hi,

Your sample result in F4 can not be correct, you have 2533 as revised allocation, but the Max capacity for that supplier is 2500 in C4.

See if this works for you:

Book3.xlsx
ABCDEF
1Original Business ShareOriginal Demand (QTY) AllocationSupplier's CapacitySupplier’s Remaining CapacityExcess demandRevised Demand (QTY) Allocation
217%1,6843,0001,316-2,160
321%2,0512,000-51512,000
423%2,2502,500250-2,340
517%1,7501,500-2502501,500
623%2,2652,000-2652652,000
710,00011,000-56610,000
Sheet1041
Cell Formulas
RangeFormula
F2:F6F2=ROUND(MIN(C2,D2/SUMIF(D$2:D$6,">0",D$2:D$6)*E$7+B2),0)

Thanks jtakw! This solution is works great. Much obliged. I did end up using a different solution, much simpler actually, posted here for reference.
 

Attachments

  • excel sample calc.png
    excel sample calc.png
    119.2 KB · Views: 10
Upvote 0
Thanks jtakw! This solution is works great. Much obliged. I did end up using a different solution, much simpler actually, posted here for reference.

That's great, but that table in your latest post is Different than what you posted in OP (e.g. D7 in your OP is just "-", whereas, in your latest pic in Post #5, is 1566, where did That come from?), So I'm not so sure it's "much simpler", since you must have updated the table with more formulas.
 
Last edited:
Upvote 0
@jtakw: Apologies for the confusion. The 1,566 in D7 is the sum of the remaining supplier capacity; [=SUMIF(D2:D6,">0"]. Then I'm using the result in D7 for the calculation entered in cells F2:F6 [=IF(D2>0,D$7*(D2/D$7)+B5,C5)]; this formula construct solved my issue without the need for additional helper columns or the use of nested IFS.
 

Attachments

  • excel sample calc.png
    excel sample calc.png
    119.2 KB · Views: 4
Upvote 0
@jtakw: Apologies for the confusion. The 1,566 in D7 is the sum of the remaining supplier capacity; [=SUMIF(D2:D6,">0"]. Then I'm using the result in D7 for the calculation entered in cells F2:F6 [=IF(D2>0,D$7*(D2/D$7)+B5,C5)]; this formula construct solved my issue without the need for additional helper columns or the use of nested IFS.

The solution/formula in my Post #4 did not use Any helper cells, helper columns, or nested IFs, just to clarify.

So, basically, you've used D7 as a Helper Cell for your formula in F2:F6, which, if combined, your 2 formulas ( D7 and F2:F6 ) is basically the same Single formula as what I posted, but you've used an IF statement where I didn't.

Here would be my formula from Post #4 for F2:F6 with the D7 formula in place:

Book3.xlsx
ABCDEF
1Original Business ShareOriginal Demand (QTY) AllocationSupplier's CapacitySupplier’s Remaining CapacityExcess demandRevised Demand (QTY) Allocation
217%1,6843,0001,316-2,160
321%2,0512,000-51512,000
423%2,2502,500250-2,340
517%1,7501,500-2502501,500
623%2,2652,000-2652652,000
710,00011,0001,56656610,000
Sheet1041
Cell Formulas
RangeFormula
F2:F6F2=MIN(C2,D2/D$7*E$7+B2)
D7D7=SUMIF(D2:D6,">0")
 
Last edited:
Upvote 0
The solution/formula in my Post #4 did not use Any helper cells, helper columns, or nested IFs, just to clarify.

So, basically, you've used D7 as a Helper Cell for your formula in F2:F6, which, if combined, your 2 formulas ( D7 and F2:F6 ) is basically the same Single formula as what I posted, but you've used an IF statement where I didn't.

Here would be my formula from Post #4 for F2:F6 with the D7 formula in place:

Book3.xlsx
ABCDEF
1Original Business ShareOriginal Demand (QTY) AllocationSupplier's CapacitySupplier’s Remaining CapacityExcess demandRevised Demand (QTY) Allocation
217%1,6843,0001,316-2,160
321%2,0512,000-51512,000
423%2,2502,500250-2,340
517%1,7501,500-2502501,500
623%2,2652,000-2652652,000
710,00011,0001,56656610,000
Sheet1041
Cell Formulas
RangeFormula
F2:F6F2=MIN(C2,D2/D$7*E$7+B2)
D7D7=SUMIF(D2:D6,">0")
Thanks again, @jtakw. Case closed! :) Lot of ways to arrive at the destination and I appreciate learning from you and others along the way.
 
Upvote 0

Forum statistics

Threads
1,214,587
Messages
6,120,406
Members
448,958
Latest member
Hat4Life

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