Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Formula Inside Switch ()

Topic Labels: Formulas
Solved
Jump to Solution
523 4
cancel
Showing results for 
Search instead for 
Did you mean: 

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

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

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!!