Sep 05, 2021 02:56 PM
Hi!
I want a field to show one of three values (Active, Expires in a week or Expired) depending on if the field “Startdatum” is after today, within a week or before today. How do I solve this?
Thanks!
Solved! Go to Solution.
Sep 05, 2021 07:14 PM
You need three nested IF() statements: one to check if the date field is filled in, one to test if its expired, and another to differentiate between those expiring within a week or sometime in the future.
IF(
{Startdatum},
IF(
{Startdatum} < TODAY(),
"Expired",
IF(
DATETIME_DIFF({Startdatum}, TODAY(), "days") <= 7,
"Expires in a week",
"Active"
)
),
"No date"
)
Sep 05, 2021 07:14 PM
You need three nested IF() statements: one to check if the date field is filled in, one to test if its expired, and another to differentiate between those expiring within a week or sometime in the future.
IF(
{Startdatum},
IF(
{Startdatum} < TODAY(),
"Expired",
IF(
DATETIME_DIFF({Startdatum}, TODAY(), "days") <= 7,
"Expires in a week",
"Active"
)
),
"No date"
)
Sep 05, 2021 09:52 PM
Worked like a charm! Thanks alot :grinning:
Sep 05, 2021 11:11 PM
Hi again! Can I have it so it doesn’t say “#ERROR” when “Startdatum” is empty?