Formula to calculate the amount of time between two dates
I'm trying to use the below formula to calculate the amount of days between when a project is due, and when it was actually finished. Sometimes this will be earlier than the due date, sometimes after.
=NETWORKDAYS([Delivery Date]98, [Power Approval]98)
When the dates are the same, I'd expect the result of zero. But it returns one.
When the project is finished a day early, I'd expect a result of -1. But it returns -2.
When the project is finished a day late, I'd expect a result of 1. But it returns a 2.
What can I add to this formula to get this right? Or is there a better one out there to try?
Comments
-
Hello,
Smartsheet treats a single day task as one working day—this concept extends to functions. NETWORKDAYS and other working day functions are designed to count the number of working days between two dates, not necessarily take the difference between two dates.
If you're looking for a different result, you might consider adding a +1 to your function:
=NETWORKDAYS([Delivery Date]98, [Power Approval]98) +1
Otherwise, you can consider taking the difference between the two dates:
=[Delivery Date]98-[Power Approval]98
This option might result in decimal values (not an exact 1 or 0), as one of your date columns will be treated as the end of the working day, and the other as the start of the working day.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.4K Get Help
- 364 Global Discussions
- 202 Industry Talk
- 430 Announcements
- 4.4K Ideas & Feature Requests
- 137 Brandfolder
- 129 Just for fun
- 128 Community Job Board
- 446 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 284 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!