I’m trying to use a formula to give the employment duration for current & past employee’s. If there is no end date set then I would like it to calculate up until the current date, otherwise It would calculate up to the end date.
I’ve tried the IF function, replacing the end results with 1 & 2 respectively and that works:
IF({End Date}=“”,1,2)
I can also get it to work by replace either of the end results with a single number;
IF({End Date}=“”,ROUND((Days(FORMAT_DATE(TODAY()),{Start date})/30),1),2)
IF({End Date}=“”,1,ROUND((Days({End Date},{Start date})/30),1))
When I put them all together it seems to break. Can anyone figure out why?
Thanks for getting back to me! The rounding function is working as intended. Perhaps I wasn’t clear enough on my main post.
The issue comes when adding the IF portion of the formula. If both Rounding formulas are contained in the IF Function then it spits out the Red Exclamation Mark unless the end date is filled.
I can’t figure out why the first part (below) works on its own, but not when paired with the other formula under the IF.
ROUND((Days(FORMAT_DATE(TODAY()),{Start date})/30),1),
monday functions are inconsistent with regard to giving an error on portions of formulas that are not needed; e.g.: IF(FALSE, 1/0, 1) will always give a divide by zero error. IF(FALSE, DIVIDE(1, 0), 1) will not.
IF(FALSE, DAYS{End Date}, TODAY()), 1) will return an “invalid parameter” error whenever {End Date} is empty.
In your formula, the portion that reads “…ROUND((Days({End Date},{Start date})/30),1)…” is returning an error whenever {End Date} is empty.
To avoid the error, you could change your formula to this: