Advanced Formula - If Date is earlier/later than Date
completed
Matt Martin
Use Case: For calculating Earned Value, I would like to create a custom formula field that displays a particular value (eg. 1) if the Due Date of a ticket is in the past, and to display another value (eg. 0) if the Due Date is still in the future. However, it appears that in an IF statement its not possible to write the following.
IF(field"Est. Hours" < TODAY(), 1, 0)
Is it not possible to compare 2 dates in a conditional statement using a less than, greater than or equals clause?
Log In
Caroline Ginty
marked this post as
completed
Caroline Ginty
Hi Matt Martin - you can absolutely use a Formula for this in ClickUp! However, the syntax to compare two dates is to use a comma between them to get the difference, and then use that operator to specify a set number of days. For your example, the formula you want is:
IF(DAYS(TODAY(), field("Est. Hours")) > 0, 1, 0)
Hope this helps, thanks!