Forum Discussion
Avoiding #NAME? Error/ Calculating date difference
I am creating a share point list that tracks our plan progress through the year. I have 2 date columns - [planned start date] and [actual start date].
I have the current formula in place:
=IF(ISBLANK([Activity Start Date]),"0",DATEDIF([Planned Start Date],[Activity Start Date],"YM"))
However, When the[actual start] is BEFORE the planned date, it gives me the #NUM? error rather than a negative value.
I have found previously the suggestion to use a formula:
=IF(ISERROR(DATEDIF(TODAY(),[Due date],"d")),"0",DATEDIF(TODAY(),[Due date],"d"))
I adapted it to fit my list:
=IF(ISBLANK([Activity Start Date]),"0",IF(ISERROR(DATEDIF([Planned Start Date],[Activity Start Date],"YM")),"0",DATEDIF(([Planned Start Date],[Activity Start Date],"YM"))
However, received a syntax error.
Abi_Mcdaniel Use this formula:
=IF(OR(ISBLANK([Activity Start Date]),ISERROR(DATEDIF([Planned Start Date],[Activity Start Date],"YM"))),"0",DATEDIF([Planned Start Date],[Activity Start Date],"YM"))
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.
2 Replies
Abi_Mcdaniel Use this formula:
=IF(OR(ISBLANK([Activity Start Date]),ISERROR(DATEDIF([Planned Start Date],[Activity Start Date],"YM"))),"0",DATEDIF([Planned Start Date],[Activity Start Date],"YM"))
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.
- Abi_McdanielCopper ContributorThank you for the quick response, this worked perfectly ganeshsanap.