Nov 17 2022 07:55 AM
I need the datedif of a cell from today to equal the number of months left on a project. The formula I have works except when it should say zero, it says #NUM!.
Nov 17 2022 02:21 PM
DATEDIF will return #NUM! if the end date of the project is earlier than today. You can get around this by wrapping DATEDIF in IFERROR:
=IFERROR(DATEDIF(TODAY(), end_date, "m"), 0)
Alternatively, use something like
=DATEDIF(TODAY(), MAX(end_date, TODAY()), "m")