Forum Discussion
Help Needed: Calculating Difference Between Two Date Columns in MS Lists
Hi vchrnk
a simple calculation with the output as days between draft and publish date:
=[Publish by]-[Draft due by]
or a more complex to calc the hours between start and end date/time:
=CONCATENATE(IF(INT(([End Date and Time]-[Start date and time])*24)>0,CONCATENATE(INT(([End Date and Time]-[Start date and time])*24)," ",IF(INT(([End Date and Time]-[Start date and time])*24)>1,"hours","hour")),""),IF(MINUTE([End Date and Time]-[Start date and time])>0,CONCATENATE(" ",MINUTE([End Date and Time]-[Start date and time])," ",IF(MINUTE([End Date and Time]-[Start date and time])>1,"minutes","minute")),""))
You can find more informations in this Microsoft Support article: https://support.microsoft.com/office/examples-of-common-formulas-in-lists-d81f5f21-2b4e-45ce-b170-bf7ebf6988b3?WT.mc_id=DX-MVP-5004845
Best, Dave
- vchrnkFeb 13, 2025Copper Contributor
Hi Dave,
Thanks for your reply. Indeed, the simple calculation works. However, in case the [End date] is still empty, it shows a negative value, which I'd like to avoid.
- DaveMehr365Feb 13, 2025MVP
Hi vchrnk
you can try this calculation:
=IF(OR(ISBLANK([Publish by]), ISBLANK([Draft due by])), "", [Publish by] - [Draft due by])
Best, Dave