I came up with the following formula.
IF({Registration date}=BLANK(),
‘’,
SWITCH({PLAN},
‘A’,
SWITCH({TYPE},
‘1’,DATEADD({Registration date},30, “days”),
‘2’,DATEADD({Registration date},30, “days”),
‘3’,DATEADD({Registration date},30, “days”)
),
‘B’,
SWITCH({TYPE},
‘2’,DATEADD({Registration date},30, “days”)),
‘3’,DATEADD({Registration date},30, “days”),
‘5’,DATEADD({Registration date},30, “days”)
) ) )
Depending on the PLAN and TYPE, we want to return the value of {Registration date} plus the number of days.
And if {Registration date} is blank, I want the value of the formula to be blank as well (to avoid #ERROR).
However, the returned value is not recognized as a date and is displayed as follows
2021-12-17t00:00:0.000z
If I remove the IF statement at the beginning, it is recognized as a date format.
Is there any way to resolve this?