
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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).

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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:
IF(DATETIME_FORMAT(YOURDATEFIELD2,'M/D/YYYY')=DATETIME_FORMAT(TODAY(),'M/D/YYYY'),"YOUR COLUMN NAME2",IF(DATETIME_FORMAT(YOURDATEFIELD3,'M/D/YYYY')=DATETIME_FORMAT(TODAY(),'M/D/YYYY'),"YOUR COLUMN NAME3"))) etc.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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).
