Calculated Column - Dynamic project end date
-
17-02-2021 - |
Question
I am building a project list that has the following columns:
The "Projected End Date" column is calculated by taking the "Start Date" and adding the number of of "Quoted Days" (removing weekends) using the following formula:
=[Start Date]+TRUNC(([Quoted Days]-1)/5,0)*7+MOD(([Quoted Days]-1),5)+IF(WEEKDAY([Start Date])+MOD(([Quoted Days]-1),5)>6,2,0)-IF(WEEKDAY([Start Date])=7,1,0)-IF(AND(OR(WEEKDAY([Start Date])=7,WEEKDAY([Start Date])=1),MOD(([Quoted Days]-1),5)=0),2,0)
This works great but I now need to factor in how many people are assigned to the project and then calculate the "Project End Date" from this.
Thus what I am trying to do is:
"Quoted Days" divided by "People" then add this number to the "Start Date" to give me the "Projected End Date". I could create another calculated column just to do the "Quoted Days divided by People" calculation and update the above formula to use the new calculated column but I wondered if there was a neater way to do this by tweaking the formula to do this calculation as well?
Any thoughts gratefully received.
Rob
Solution
Keeping the current formula intact, we can replace [Quoted Days] with INT([Quoted Days]/People) assuming fraction to be rounded to the nearest whole number.
=[Start Date]+TRUNC((INT([Quoted Days]/People)-1)/5,0)*7+MOD((INT([Quoted Days]/People)-1),5)+IF(WEEKDAY([Start Date])+MOD((INT([Quoted Days]/People)-1),5)>6,2,0)-IF(WEEKDAY([Start Date])=7,1,0)-IF(AND(OR(WEEKDAY([Start Date])=7,WEEKDAY([Start Date])=1),MOD((INT([Quoted Days]/People)-1),5)=0),2,0)
When [People]=1 should show the values for the original formula
The updated formula will take effect when [People]>1
Updating to round the fraction to 1 decimal place. To see the effect of this change, [Start Date] and [Project End Date] should be formatted to [Date and Time].
The updated formula
=[Start Date]+TRUNC((ROUND([Quoted Days]/People,1)-1)/5,0)*7+MOD((ROUND([Quoted Days]/People,1)-1),5)+IF(WEEKDAY([Start Date])+MOD((ROUND([Quoted Days]/People,1)-1),5)>6,2,0)-IF(WEEKDAY([Start Date])=7,1,0)-IF(AND(OR(WEEKDAY([Start Date])=7,WEEKDAY([Start Date])=1),MOD((ROUND([Quoted Days]/People,1)-1),5)=0),2,0)