Help

Re: Formula Inside Switch ()

Solved
Jump to Solution
1384 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Ryan_Gray
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi there! I’m an Airtable noob, but a spreadsheet lover.

I’m trying to create a formula (Switch looked like the best), that will create custom dates based on the “Task Name.” It involves date math based on “Original Publish Date” field which is a date.

Here is a rough example of what I’m trying:
SWITCH(
{Task Name},
“Create Illustration”, DATEADD({Original Publish Date},-14,‘days’),
“Generate blog post and schedule post”, DATEADD({Original Publish Date},-13,‘days’),
“Create snippets for social media”, DATEADD({Original Publish Date},-12,‘days’),
)

I’ve tried paranthesis around dateadd and end before the comma. That didn’t work either.

Is this possible? I see other formulas that seem to work.

1 Solution

Accepted Solutions
ScottWorld
18 - Pluto
18 - Pluto

You have an extra comma at the end of that last long line.

Also, make sure that you’re only using straight quotes instead of curly quotes throughout your formula. Airtable will choke on all curly quotes.

See Solution in Thread

4 Replies 4
ScottWorld
18 - Pluto
18 - Pluto

You have an extra comma at the end of that last long line.

Also, make sure that you’re only using straight quotes instead of curly quotes throughout your formula. Airtable will choke on all curly quotes.

Doh! That was the culprit. Both the comma and the curly quotes. One other thing I’m seeing is that the results includes the time. The starting field is just MM/DD/YYYY and the formula is MM/DD/YYYY HH:MM:SS. I can’t see a way of formatting that?

There should be a formatting tab to click on, where you can turn off the time.

ha! It’s hiding inside the customize field type. I was looking for it outside. Thanks!!