Trying to use "if" and "date difference" together

Hi! My formula to flag an older blog post as in need of an update isn’t working and I’m not sure why. Here’s the formula:

IF(DATETIME_DIFF({Date Last Updated},TODAY(), ‘months’) > 12, “Update”, " ")

The logic I want is this:
If more than 12 months have elapsed between the date indicated in the {Date Last Updated} field and today, I would like the cell to say “Update.” Else, blank.

Can anyone advise?

Welcome to the community, @Lia_Garcia! :smiley: If the first date passed to DATETIME_DIFF() is older than the second one, the result will be a negative number, which means the comparison to see if that number is greater than 12 will never be true. This could be solved by either swapping the first two arguments:

IF(DATETIME_DIFF(TODAY(), {Date Last Updated}, 'months') > 12, "Update")

…or changing the comparison to look for a number less than -12:

IF(DATETIME_DIFF({Date Last Updated}, TODAY(), 'months') < -12, "Update")

In both of these, notice how I left off the empty string at the end. The final piece of an IF() function is optional; if omitted, it will automatically return the proper blank value based on the data type that the other portion returns.

1 Like

Worked like a charm! Thank you!

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.