I have been trying to do this for a few days now and have not been able to wrap my head around it.
I have a worksheet, and in Column A, I will be listing out Project Numbers. Each project will have an assigned Value stating the Amount of Sheet Metal Needing to be produced for it. These values are in Column B. In Cell L1, I have the Maximum Sheet Metal that we can produce in one day. This amount may vary based on future expansion, the current value is 8000. In Column C, I am summing The previous projects Sheet Metal Value and the current projects sheetmetal value. In Column D, I am comparing these values to be sure nothing is over the daily maximum limit, then assigning it a "Day" for right now. What I need is to eventually assign it to a specific day based on these calculations. The problem I am currently running into are these.
A. If a Project requires more than the daily limit, I need to Split it into two days.
B. I have Two projects that should go on the same day, however it has been split into two days for some reason. This is occuring on Rows 12 and 13.
Formula in Column C:
=IF(B2>=$L$1,IF(B2=8000,8000, IF(C1="LIMIT",IF(B2>=$L$1,"LIMIT",B2), IF(B1+B2>=$L$1,IF(B2>$L$1,"SPLIT",B2), SUM(B1+B2)))),IF(C1="LIMIT",IF(B2>=$L$1,"LIMIT",B2), IF(B1+B2>=$L$1,IF(B2>$L$1,"SPLIT",B2),SUM(B1+B2))))
Formula in Column D:
=IF(C2<$L$1,IF(C2<C1,D1+1,IF(C1+B2>C2,D1+1,D1)),D1+1)
Thank-you in advance for any help!