I am trying to calculate the amount of days between the current date and then determine whether something is out of SLA based on the amount of days difference. The issue that I am running into is that since I essentially want to exclude weekends then if the current day is Monday or Tuesday the line should be included if the age is >5 and otherwise the line should be included if the age is >2. Below is the formula I am using and even though today, the day I am writing this, is Tuesday the line is included despite the age being 3. Any idea on why the formula is not working. See the formula and the item that is being included in error.
Formula:
if
IsEmpty([Comments]) and
datetimeformat(DateTimeToday(), "%A") = "MONDAY"
and [Age] > 5
then "Y"
elseif
(IsEmpty([Comments])
and
(DateTimeFormat(DateTimeToday(), "%A") = "TUESDAY")
and [Age] > 5)
then "Y"
elseif
IsEmpty([Comments]) and [Age] > 2
then "Y"
else
"N"
endif