Sep 02, 2020 11:02 PM
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.
Solved! Go to Solution.
Sep 03, 2020 05:47 AM
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.
Sep 03, 2020 05:47 AM
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.
Sep 03, 2020 07:23 AM
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?
Sep 03, 2020 07:27 AM
There should be a formatting tab to click on, where you can turn off the time.
Sep 03, 2020 07:31 AM
ha! It’s hiding inside the customize field type. I was looking for it outside. Thanks!!