Hi All,
I'm trying to make a sheet where Column A indicates a starting week, Column B is the total amount of hrs required and C:BB are the weeks of the year.
What I'm trying to accomplish is, in this scenario, having no more than 180 hrs consumed in a week, with the spill over going to the next week, cascading until the total remaining hrs is less than column B
Week 1 is simple, as there is nothing before it. As a formula, I have:
=IF(A2>1,0,IF(AND(B2>180,A2=1),180,B2))
Week 2 also seems to be working, where I have:
=IF(AND(SUM(C2<B2),A2<2),IF(B2-SUM(C2)>180,180,B2-SUM(C2)),IF(A2>2,0,IF(AND(B2>180,A2=2),180,B2-SUM(C2))))
The problem seems to arise from Week 3 on, and I've hit a wall I think.
=IF(AND(SUM($C2:D2<B2),A2<3),IF(B2-SUM($C2:D2)>180,180,B2-SUM($C2:D2)),IF(A2>3,0,IF(AND(B2>180,A2<=3),180,B2-SUM($C2:D2))))
If the starting week number is changed from 2 to 1, Week 3 shows 180 and week 4 shows -40, where I would like week 3 to show 140 and week 4 to show 0
If the starting week number is changed from 2 to 3, week 3 shows 180 hrs, and week 4 shows 320 hrs, where I would like week 4 to show 180 hrs and week 5 to show 140 hrs.
I'm sure the solution is something simple that I'm overlooking, but my brain and eyeballs hurt from staring at this so long![]()
Bookmarks