Forum Discussion
analysta
Feb 23, 2023Copper Contributor
SharePoint Calculated Column Blanks & Negative numbers
Hello - I have a calculated column that calculates the amount of days until the due date. My formula is: =DATEDIF(TODAY(),[Contract Expiration Date],"D") How can I revise this formula so I don't ge...
- Mar 07, 2023I figured out the correct formula. Here it is in case anyone else needs it.
=IF(ISBLANK([Contract Expiration Date]),"",IF(ISERROR(DATEDIF(TODAY(),[Contract Expiration Date],"d")),-DATEDIF([Contract Expiration Date],TODAY(),"d"),DATEDIF(TODAY(),[Contract Expiration Date],"d")))
analysta
Copper Contributor
I figured out the correct formula. Here it is in case anyone else needs it.
=IF(ISBLANK([Contract Expiration Date]),"",IF(ISERROR(DATEDIF(TODAY(),[Contract Expiration Date],"d")),-DATEDIF([Contract Expiration Date],TODAY(),"d"),DATEDIF(TODAY(),[Contract Expiration Date],"d")))
=IF(ISBLANK([Contract Expiration Date]),"",IF(ISERROR(DATEDIF(TODAY(),[Contract Expiration Date],"d")),-DATEDIF([Contract Expiration Date],TODAY(),"d"),DATEDIF(TODAY(),[Contract Expiration Date],"d")))
ganeshsanap
Mar 08, 2023MVP
analysta Or something like this might also work for you:
=IF(ISBLANK([Contract Expiration Date]),"",IF(TODAY()>=[Contract Expiration Date],DATEDIF([Contract Expiration Date],TODAY(),"d"),DATEDIF(TODAY(),[Contract Expiration Date],"d")))
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs