Skip to main content
Solved

Combining formulas with dates

  • July 6, 2023
  • 1 reply
  • 11 views

Forum|alt.badge.img+2

Hello!

So i was wondering if it was possible to create a formula (or combine formulas) in order to use the data from one date field and add 7 days to it in another. and then filter it if the project status matches certain conditions.

I got the first part to work using: 

DATEADD({Project Date}, 7, "days"
which worked perfectly, 
 
but im not sure if its possible to then have it say "not needed" or even have it be blank if the project type matches certain conditions and still show the date if it matches other conditions!
 
I also tried this:
IF(
OR(
{Project Type} = "Wedding",
{Project Type} = "Elopement"
),
DATEADD({Project Date}, 7, "days"),
IF(
AND(
OR(
{Project Type} = "Couples",
{Project Type} = "Family"
),
"Not Needed",
"Not Needed"
)
)
)
 
which kinda worked but it only filled in the wedding date status and not of the other options.
 
Let me know if that makes sense and if you can help please 🙂

Best answer by Sho

Hello @virtuallyaurora ,

SWITCH() is more concise for simple multiple conditionals.

SWITCH({Project Type}, "Wedding", DATETIME_FORMAT(DATEADD({Project Date}, 7, "days"),"YYYY/MM/DD"), "Elopement", DATETIME_FORMAT(DATEADD({Project Date}, 7, "days"),"YYYY/MM/DD"), "Couples", "Not Needed", "Family", "Not Needed", "" )

 

1 reply

Forum|alt.badge.img+21
  • Inspiring
  • Answer
  • July 7, 2023

Hello @virtuallyaurora ,

SWITCH() is more concise for simple multiple conditionals.

SWITCH({Project Type}, "Wedding", DATETIME_FORMAT(DATEADD({Project Date}, 7, "days"),"YYYY/MM/DD"), "Elopement", DATETIME_FORMAT(DATEADD({Project Date}, 7, "days"),"YYYY/MM/DD"), "Couples", "Not Needed", "Family", "Not Needed", "" )