Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Aug 08, 2023 02:51 PM
I'm getting an invalid Switch formula, even though it's super simple.
I have several columns of singular date fields. Each date field is a milestone. I'm writing a simple Switch formula to check if Today() = one of the date fields, then if so say the column's name.
I've simplified this formula to it's most basic to evaluate against itself and I'm still getting an invalid formula. What am I overlooking?
SWITCH(
TODAY(),
TODAY(),"yes",
"no"
)
Solved! Go to Solution.
Aug 08, 2023 04:57 PM
SWITCH function patterns can only be strings or numbers. Variables and expressions are invalid.
For example, you could use a conditional expression with a date difference (such as 0 for today).
Aug 08, 2023 04:28 PM
It's the double TODAY() that's causing the error. Im not exactly sure your use case but "today" in a formula doesn't work exactly as expected when comparing it to another date field without formatting it. I would suggest:
Aug 08, 2023 04:57 PM
SWITCH function patterns can only be strings or numbers. Variables and expressions are invalid.
For example, you could use a conditional expression with a date difference (such as 0 for today).