How to allocate project hours between specific dates using specific daily hour burn rates and including awkward calendar month start/end+holidays

Jeremy901

New Member
Joined
Jan 9, 2024
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi,
I am trying to create a tricky formula and have come close twice but not exactly what I need, maybe you could help?

I have a quantity of hours (project) that needs to have a specific start and end date. Then that quantity of hours between specific dates needs to be spread across specific months.

1st problem- The months start and end dates aren't exactly as per the generic calendar so must be specified in a separate cell.

2nd problem- a value in a different cell defines how many hours can be burnt from the project total per day.

3rd problem- The formula must realise that Mon- Fri are full working days but Sat and Sunday are 1/4 of the full working day capacity/burn rate.

4th Problem- The formula must also recognise holidays when all operations are shutdown (typically 10days over Christmas period depending on calendar days and how they fall)

Example:
A project has a total of 7,700 hours. To be worked at full capacity Monday-Friday, 1/4 capacity Saturday and Sunday and excluding holiday shutdown (23/DEC/23 - 01/JAN/24).

The project start is 14/DEC/24 and the end date is 19/JAN/24 (7700 hrs must be spread between these dates according to the capacity burn on ITEM 3=330 hrs a day but must also account for the calendar start/ends as well as including holiday shutdown days(all seen in this message))

The capacity hours that can be burnt in a day are set values depending on which item type is being worked on. IF item 3=330hrs per day, item A=325, item 5=420, item 6=450 , item 8= 275 & item PL=100.

Calendar start end dates are as follows:
DEC start= 28/NOV/23.
DEC end= 31/DEC/23 (no working days from/to 23/12/23 - 01/01/2024, last day of work is 22nd DEC).
JAN start= 01/JAN/24 (no working days on the 01/JAN/24) so actual start is the 2nd JAN.
JAN end= 31/JAN/24.

Maybe you could suggest a formula for these parameters??

I've tried a couple of ways that seem to be almost correct but they are not 100% and I need better accuracy. For example I had two projects of 7,700 on item 3 (daily burn 330hrs) that start in December ( one on the 14-DEC and the other on the 17-DEC) and they both end on JAN 19th. However the hours allocated in January aren't the same because the formula I use breaks the total hours between months as a percentage of 100 so while January should be the same (because it has the same possible amount of days to burn daily hours) it is different because my formula spreads more hours into December due to the earlier start date.

I tried to attach a picture of this explanation but I cant paste into this message box or attach elsewhere. I'd be happy to have a video call to show visually if that helps.
 
Here you go including the Bank Holidays:
(In the next post i'll explain how the formula works)

ProjectHours.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAAB
1
201/12/202301/01/202401/02/202429/02/202404/04/202402/05/202430/05/202404/07/202401/08/202429/08/202403/10/202431/10/202428/11/202401/01/202501/02/202501/03/2025
331/12/202331/01/202428/02/202403/04/202401/05/202429/05/202403/07/202431/07/202428/08/202402/10/202430/10/202427/11/202431/12/202431/01/202528/02/202503/04/2025
4StartEndWorking DaysBurn RateHour needed to complete the proyectForecast calculated hoursDec-23Jan-24Feb-24Mar-24Apr-24May-24Jun-24Jul-24Aug-24Sep-24Oct-24Nov-24Dec-24Jan-25Feb-25Mar-25Add new columns to the left of thisHolidays1/4 Burn Rate Holidays
508/12/202322/01/20243636312,878.010,345.54,356.05,989.5--------------23/12/202305/02/2024
614/12/202319/01/2024273637,700.08,167.52,722.55,445.0--------------24/12/202318/03/2024
717/12/202319/01/2024243637,700.07,350.81,905.85,445.0--------------25/12/202301/04/2024
820/01/202411/02/2024233637,700.05,898.8-3,267.02,631.8-------------26/12/202306/05/2024
927/12/202303/07/2024
1028/12/202305/08/2024
1129/12/202328/10/2024
1230/12/2023
1331/12/2023
1401/01/2024
Sheet1
Cell Formulas
RangeFormula
I2:W2I2=H3+1
H5:W8H5=LET( projStart, $A5, projEnd, $B5, monthStart, H$2, monthEnd, H$3, projBurnRate, $D5, d, SEQUENCE(projEnd-projStart+1,, projStart), fd, FILTER(d, (d>=monthStart)*(d<=monthEnd)), isWorkDay, WORKDAY.INTL(fd-1,1,"0000000",Holidays)=fd, isFullWorkingDay, WORKDAY.INTL(fd-1,1,"0000000",HolidaysQuarterBurnRate)=fd, burnRate, (0.25+0.75*(WEEKDAY(fd,2)<6)*isFullWorkingDay)*projBurnRate, IFERROR(SUM(isWorkDay*burnRate),0) )
C5:C8C5=NETWORKDAYS.INTL(A5,B5,"0000000",Holidays)
F5:F8F5=SUM(H5:X5)
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
LET is a function that lets you define variables and reuse them. It is not always necessary to use LET, in fact the whole formula could be written without LET function but I like it because it make it more readable and easier to work on.
How does LET work? You can read this here: https://support.microsoft.com/en-au/office/let-function-34842dd8-b92b-4d3f-b325-b8b8f9908999#:~:text=The%20LET%20function%20assigns%20names,through%20Excel's%20native%20formula%20syntax.
Basically you define variables in pairs of arguments, and the last argument is the final calculation.
The example
Excel Formula:
=LET(x, 1, y, 2, x*y)
you define x assign it the value 1, define y assign the value 2 and last the calculation x*y.
Now the value you assign to a variable (or "name" as Microsoft calls them in their support page) can be also a formula. For example:
Excel Formula:
=LET(x, A1+3, y, B1*2, x*y)

WORKDAY.INTL like WORKDAY gives you the next workday starting at a given date and going forwards or backwards a given number of days, with the difference that you can define custom weekend.
WORKDAY.INTL function - Microsoft Support
For the 3rd parameter you can input a number (1-7 and 11-17) or you can write a string 7 characters long (which i learn pretty recently from this forum). So that you can customize your weekend. A 0 is a working day, a 1 is a weekend starting on monday (refer to support page).
Now if you include the las parameter (Holidays), and enter here a range of dates, they are excluded from working days.
So by doing this:

Excel Formula:
=WORKDAY.INTL(A1-1,1,"0000000",Holidays)

Given the date in A1, subtracting 1 day, going forwards 1 day, with no weekend, and excluding holidays, i will get the same date again from A1 if A1 is not a holiday and get next workday different from A1 if A1 is one of the holidays.
So by doing this comparison
=WORKDAY.INTL(A1-1,1,"0000000",Holidays)=A1
I will know if A1 is a holiday or not.

Now to our formula:
Lets look at a small example:

ProjectHours2.xlsx
BCDEFGHIJKLMNO
1Proj Burn rate363
2
3depends on Holidaysdepends on Bank Holidays3539.25
4StartEndWorking DaysDatesIs Working dayIs Full Working DayBurn rateHour burned per dayHolidays1/4 Burn Rate Holidays
520/12/202310/01/2024122023/12/20 WedTRUETRUE136323/12/202305/02/2024
62023/12/21 ThuTRUETRUE136324/12/202318/03/2024
72023/12/22 FriTRUETRUE136325/12/202301/04/2024
82023/12/23 SatFALSETRUE0.25026/12/202306/05/2024
92023/12/24 SunFALSETRUE0.25027/12/202303/07/2024
102023/12/25 MonFALSETRUE1028/12/202305/08/2024
112023/12/26 TueFALSETRUE1029/12/202328/10/2024
122023/12/27 WedFALSETRUE1030/12/202303/01/2024
132023/12/28 ThuFALSETRUE1031/12/2023
142023/12/29 FriFALSETRUE1001/01/2024
152023/12/30 SatFALSETRUE0.250
162023/12/31 SunFALSETRUE0.250
172024/01/01 MonFALSETRUE10
182024/01/02 TueTRUETRUE1363
192024/01/03 WedTRUEFALSE0.2590.75
202024/01/04 ThuTRUETRUE1363
212024/01/05 FriTRUETRUE1363
222024/01/06 SatTRUETRUE0.2590.75
232024/01/07 SunTRUETRUE0.2590.75
242024/01/08 MonTRUETRUE1363
252024/01/09 TueTRUETRUE1363
262024/01/10 WedTRUETRUE1363
272024/01/11 Thu
282024/01/12 Fri
292024/01/13 Sat
Sheet1 (2)
Cell Formulas
RangeFormula
K3K3=SUM(K5:K44)
D5D5=NETWORKDAYS.INTL(B5,C5,"0000000",Holidays)
H5:H26H5=WORKDAY.INTL(G5-1,1,"0000000",Holidays)=G5
I5:I26I5=WORKDAY.INTL(G5-1,1,"0000000",HolidaysQuarterBurnRate)=G5
J5:J26J5=0.25+0.75*(WEEKDAY(G5,2)<6)*I5
K5:K26K5=$K$1*J5*H5
G5G5=B5
G6:G29G6=G5+1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G5:G44Expression=WEEKDAY(G5,2)>5textNO


First we create the list of dates from start to end.
Then we calculate if it is a working day or not (column H) considering Holidays (from 23dec to 1jan).
Then we calculate if it is a full working day (column I) depending on the Bank Holidays (I added 03/01/2024 just to see how it affects the result).
Then we calculate the burn rate. Here WEEKDAY(G5,2) gives me 1 for monday to 5 friday, 6 and 7 are sat and sun. So if the number is smaller than 6 its a normal weekday. So if it is a normal weekday and it is a full working day (not a bank holiday) we end up adding 0.25 to 0.75 and get 1. Else if it is a weekend or it is a bank Holiday (WEEKDAY(G5,2)<6) will return FALSE or Full working day will be FALSE. And, if you use a logical data type in a calculation TRUE is considered 1, and FALSE a 0. So if any of these two are 0 you get only 0.25 as a result.
Then we multiply the logical column "Is Working Day" with the "Burn Rate" times the Proj Burn Rate (in our example 363) and get the hours burn for that each day.
Last we sum up all the calculated hour.

Now we use the LET function to do the same.
First we create the sequence of dates with this part of the function:
Excel Formula:
d, SEQUENCE(projEnd-projStart+1,, projStart),
This will give you an vertical array of dates from start to end date.
Then in the next line you filter this array with the start and end days of month of the current column:
Excel Formula:
fd, FILTER(d, (d>=monthStart)*(d<=monthEnd)),
After we check if it is a working day:
Excel Formula:
isWorkDay, WORKDAY.INTL(fd-1,1,"0000000",Holidays)=fd,
See if it is a fullWorking day:
Excel Formula:
isFullWorkingDay, WORKDAY.INTL(fd-1,1,"0000000",HolidaysQuarterBurnRate)=fd,
and calculate the burn rate for each day:
Excel Formula:
burnRate, (0.25+0.75*(WEEKDAY(fd,2)<6)*isFullWorkingDay)*projBurnRate,
All of the above produce vertical arrays of the same lenght as days are left after filtering by month start and end.
Last we multply isWorkDay times burnRate and sum all up.
For the case in which filter function returns 0 items, actually #Calc error, (no proyect days in the given month) we use the IFERROR to return 0.

Hope all this makes sense.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,951
Members
449,095
Latest member
nmaske

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