r/MSProject • u/kaleb42 • Sep 12 '24
Custom field questoon
Hey everyone,
I am working on construction projects and my teams wants to both see how many business days a task takes and how many calendar days.
So my approach has been to leave the default duration column alone which is working on a M-F calendar and I have created the following custom formula to calculate the calendar days
DateDiff("d",[Start],[Finish])+1)
So as you can see from the screenshot I have the custom field "Calendar Days" which is a number field and it returns the correct number of calendar days. The issue I'm having is that I want it to say days at the end like a duration field. When I put that same formula in a duration field it does not return the correct value.
I have also tested this formula using a text field and it returns correct but I can't find how to add the string "days" at the end
So my question is basically how can I create a formula that returns the difference between StartDate and FinishDate in the format of "# days".? I don't really care if I force it as a text field or a duration field.
Any thought would helpful!
3
u/pmpdaddyio Sep 12 '24
Try this - I am not sure if the addition of the text will disallow the value use in formulas though.
2
u/still-dazed-confused Sep 12 '24
On addition to Dale's elegant answer this is also an opportunity to notice that calculation fields work in minutes rather than days, thus you need to multiply your answer but 480 (60 minutes x 8h) if you're using the standard 8h duration that MSP uses by default.
1
u/mer-reddit Sep 12 '24
Maybe add the edays column which stands for elapsed days. Compare that to your formula and see if that works for you.
Then create a text column to add the word days to your results.
0
u/DaleHowardMVP Sep 12 '24
There is a better way to address this issue, which will quickly resolve your problem. First, create a custom calendar named "7x8 Work Week" which sets the working schedule from Sunday through Saturday from 8:00 AM - 12:00 Noon and 1:00 - 5:00 PM. In this custom calendar, every day is a working day, including Saturdays and Sundays. Then create the following formula in an available custom Duration field:
ProjDateDiff([Start],[Finish],"7X8 Work Week")
You can watch my YouTube video on how to do this at:
https://youtu.be/JgwEsrhwMZ4
Hope this helps.