Increase by n until formula works

Pestomania

Active Member
Joined
May 30, 2018
Messages
292
Office Version
  1. 365
Platform
  1. Windows
Below is a table which I am trying to identify formulas which would identify if current capacity is less than total hours needed, it changes implement 3rd shift to (1) and then increases proposed equipment by (+n) until proposed capacity is greater than total hrs needed. I have filled in Sept 23 through Dec 23 as an example. I left MAy 23 to Aug 23 for your purpose.

Book1
ABCDEFGHIJK
123-May23-Jun23-Jul23-Aug23-Sep23-Oct23-Nov23-Dec
2Number of Equipment11111222This is a static value
3Number of hrs per Equipment300300300300300300300300This is a static value
4Utilization Rate90%90%90%90%90%90%90%90%This is a static value
5Program 1 (hrs required)100100300300300300300300
6Program 2 (hrs required)200200400400900120018002200
7Total Hrs needed3003007007001200150021002500
8Current Capacity270270270270270540540540
9Proposed Capacity2702702702701296172821602592
10Proposed Equipment00002234 if current capacity is less than total hours needed, it changes implement 3rd shift to (1) and then increases proposed equipment by (+n) until proposed capacity is greater than total hrs needed.
11Implement 3rd Shift00001111This field should change to 1 before proposed equipment
Sheet1
Cell Formulas
RangeFormula
B7:I7B7=SUM(B5:B6)
B8:I8B8=B2*B3*B4
B9:I9B9=B4*IF(B11=1,480,B3)*(B2+B10)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B9:I9Cell Value<B$7textNO
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Try the following:
Book1
ABCDEFGHIJK
123-May23-Jun23-Jul23-Aug23-Sep23-Oct23-Nov23-Dec
2Number of Equipment11111222This is a static value
3Number of hrs per Equipment300300300300300300300300This is a static value
4Utilization Rate90%90%90%90%90%90%90%90%This is a static value
5Program 1 (hrs required)100100300300300300300300
6Program 2 (hrs required)200200400400900120018002200
7Total Hrs needed3003007007001200150021002500
8Current Capacity270270270270270540540540
9Proposed Capacity4324328648641296172821602592
10Proposed Equipment00112234 if current capacity is less than total hours needed, it changes implement 3rd shift to (1) and then increases proposed equipment by (+n) until proposed capacity is greater than total hrs needed.
11Implement 3rd Shift11111111This field should change to 1 before proposed equipment
Sheet1
Cell Formulas
RangeFormula
B7:I7B7=SUM(B5:B6)
B8:I8B8=B2*B3*B4
B9:I9B9=CEILING(B7,B4*IF(B11=1,480,B3))
B10:I10B10=B9/(B4*IF(B11=1,480,B3))-B2
B11:I11B11=IF(B8<B7,1,0)
 
Upvote 0
Try the following:
Book1
ABCDEFGHIJK
123-May23-Jun23-Jul23-Aug23-Sep23-Oct23-Nov23-Dec
2Number of Equipment11111222This is a static value
3Number of hrs per Equipment300300300300300300300300This is a static value
4Utilization Rate90%90%90%90%90%90%90%90%This is a static value
5Program 1 (hrs required)100100300300300300300300
6Program 2 (hrs required)200200400400900120018002200
7Total Hrs needed300300700700120050021002500
8Current Capacity270270270270270540540540
9Proposed Capacity4324328648641296172821602592
10Proposed Equipment00112234 if current capacity is less than total hours needed, it changes implement 3rd shift to (1) and then increases proposed equipment by (+n) until proposed capacity is greater than total hrs needed.
11Implement 3rd Shift11111111This field should change to 1 before proposed equipment
Sheet1
Cell Formulas
RangeFormula
B7:I7B7=SUM(B5:B6)
B8:I8B8=B2*B3*B4
B9:I9B9=CEILING(B7,B4*IF(B11=1,480,B3))
B10:I10B10=B9/(B4*IF(B11=1,480,B3))-B2
B11:I11B11=IF(B8<B7,1,0)
This works exactly as I requested it to, but I forgot one important part.

If the field to the left is a number, the minimum number is that. In G6, the demand dropped for that month, which changes proposed equipment back to 1. Since we aren't going to remove equipment bakc and forth due to drop in demand, we would need to maintain the fact that (2) machines are installed at that point.

I hope this makes sense.

Book1
ABCDEFGHIJK
123-May23-Jun23-Jul23-Aug23-Sep23-Oct23-Nov23-Dec
2Number of Equipment11111222This is a static value
3Number of hrs per Equipment300300300300300300300300This is a static value
4Utilization Rate90%90%90%90%90%90%90%90%This is a static value
5Program 1 (hrs required)100100300300300300300300
6Program 2 (hrs required)20020040040090020018002200
7Total Hrs needed300300700700120050021002500
8Current Capacity270270270270270540540540
9Proposed Capacity4324328648641296172821602592
10Proposed Equipment00112134 if current capacity is less than total hours needed, it changes implement 3rd shift to (1) and then increases proposed equipment by (+n) until proposed capacity is greater than total hrs needed.
11Implement 3rd Shift11111111This field should change to 1 before proposed equipment
Sheet1
Cell Formulas
RangeFormula
B7:I7B7=SUM(B5:B6)
B8:I8B8=B2*B3*B4
B9:I9B9=CEILING(B7,B4*IF(B11=1,480,B3))
B10:I10B10=B9/(B4*IF(B11=1,480,B3))-B2
B11:I11B11=IF(B8<B7,1,0)
 
Upvote 0
There are some things I don't understand. Your logic in bothe your posts says that if the current capacity (row 8) is less than total hours needed (row 7) then Implement 3rd Shift becomes 1. In your example in post #3 your current capacity (row 8) is not less than total hours needed (row 7) - so why is it not showing 0? Do you want that Implement 3rd Shift figure in row 11 to remain at 1 if the cell to the left is already 1?
To accommodate the additional condition you've now introduced will take a great deal of thinking (it won't happen until tomorrow) and I'm not sure I can come up with a solution.
 
Upvote 0
There are some things I don't understand. Your logic in bothe your posts says that if the current capacity (row 8) is less than total hours needed (row 7) then Implement 3rd Shift becomes 1. In your example in post #3 your current capacity (row 8) is not less than total hours needed (row 7) - so why is it not showing 0? Do you want that Implement 3rd Shift figure in row 11 to remain at 1 if the cell to the left is already 1?
To accommodate the additional condition you've now introduced will take a great deal of thinking (it won't happen until tomorrow) and I'm not sure I can come up with a solution.
Hi Kevin, yes. The concept being once a machine is installed or a shift is implemented, it will stay that way till the end of time.
 
Upvote 0
This is about the best I can get it, taking your latest condition into account. If this doesn't give you what you want, I'm afraid I'll have to leave it to others to finalise your requirements.

MULTI on hold.xlsm
ABCDEFGHIJK
123-May23-Jun23-Jul23-Aug23-Sep23-Oct23-Nov23-Dec
2Number of Equipment11111222This is a static value
3Number of hrs per Equipment300300300300300300300300This is a static value
4Utilization Rate90%90%90%90%90%90%90%90%This is a static value
5Program 1 (hrs required)100100300300300300300300
6Program 2 (hrs required)20020040040090020018002200
7Total Hrs needed300300700700120050021002500
8Current Capacity270270270270270540540540
9Proposed Capacity432432864864129686421602592
10Proposed Equipment00112234 if current capacity is less than total hours needed, it changes implement 3rd shift to (1) and then increases proposed equipment by (+n) until proposed capacity is greater than total hrs needed.
11Implement 3rd Shift11111111This field should change to 1 before proposed equipment
Sheet1
Cell Formulas
RangeFormula
B7:I7B7=SUM(B5:B6)
B8:I8B8=B2*B3*B4
B9:I9B9=CEILING(B7,B4*IF(B11=1,480,B3))
B10:I10B10=IF(AND(B9/(B4*IF(B11=1,480,B3))-B2=0,AND(ISNUMBER(A10),A10>0)),A10,B9/(B4*IF(B11=1,480,B3))-B2)
B11B11=IF(B8<B7,1,0)
C11:I11C11=IF(C8<C7,1,IF(B11>0,B11,0))
 
Upvote 0
Solution
This is about the best I can get it, taking your latest condition into account. If this doesn't give you what you want, I'm afraid I'll have to leave it to others to finalise your requirements.

MULTI on hold.xlsm
ABCDEFGHIJK
123-May23-Jun23-Jul23-Aug23-Sep23-Oct23-Nov23-Dec
2Number of Equipment11111222This is a static value
3Number of hrs per Equipment300300300300300300300300This is a static value
4Utilization Rate90%90%90%90%90%90%90%90%This is a static value
5Program 1 (hrs required)100100300300300300300300
6Program 2 (hrs required)20020040040090020018002200
7Total Hrs needed300300700700120050021002500
8Current Capacity270270270270270540540540
9Proposed Capacity432432864864129686421602592
10Proposed Equipment00112234 if current capacity is less than total hours needed, it changes implement 3rd shift to (1) and then increases proposed equipment by (+n) until proposed capacity is greater than total hrs needed.
11Implement 3rd Shift11111111This field should change to 1 before proposed equipment
Sheet1
Cell Formulas
RangeFormula
B7:I7B7=SUM(B5:B6)
B8:I8B8=B2*B3*B4
B9:I9B9=CEILING(B7,B4*IF(B11=1,480,B3))
B10:I10B10=IF(AND(B9/(B4*IF(B11=1,480,B3))-B2=0,AND(ISNUMBER(A10),A10>0)),A10,B9/(B4*IF(B11=1,480,B3))-B2)
B11B11=IF(B8<B7,1,0)
C11:I11C11=IF(C8<C7,1,IF(B11>0,B11,0))
Thank you! this seems to do the trick.
 
Upvote 0

Forum statistics

Threads
1,215,084
Messages
6,123,029
Members
449,092
Latest member
ikke

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