When you put just a reference to the field in the IF() function as the condition, the function tries to evaluate the value of the field itself and determine if that value is “truthy” or “falsey”.
Any value other than a 0 is a “truthy” value, and the IF() statement processes the true response.
A blank cell or a natural 0 is a “falsey” value, and the IF() statement processes the false response.
Without this small change, the field will be blank both when {Days Left} is blank and when {Days Left} is zero. However, when {Days Left} is zero you actually want a value! Including & "" after the field name fixes this problem.
Thanks so much! I’m getting a weird thing with the Workday Diff code (adding the & “” didn’t affect it’s math)
IF(Starts & "", WORKDAY_DIFF(TODAY(),Starts))
where if the Starts Date is today it says 1 day left, and if its yesterday, it says -2
That math seems wrong to me…
I don’t actually know how to get zero
Adding & "" would only affect the result when {Days Left} is zero. There will be no change in most cases.
WORKDAY_DIFF counts each day as a full day, so when the start and end date are the same, that still counts as 1 day (assuming that the date is a work day).
WORKDAY_DIFF will produce a zero when both dates are in the same weekend (depending on timezone issues).