Feb 13, 2019 09:08 AM
I am trying to convert between WEEKDAY(TODAY() and the word version for the day of the week. I would imagine it is a common need.
This works just fine.
IF(WEEKDAY(TODAY())=1,“Monday”, “”)
Why might this not work?
IF(WEEKDAY(TODAY()) = 1,”Monday”,
IF(WEEKDAY(TODAY()) = 2,”Tuesday”, ”Wednesday”))
My error: Sorry, there was a problem saving this field. Invalid formula. Please check your formula text.
Feb 13, 2019 09:14 AM
The problem is the ”
's in your formula. You’re using curly quotes. Airtable only recognizes straight quotes which look like this "
. Replace the curly quotes with straight ones and your formula works, your nesting is perfectly fine as is.
Feb 13, 2019 09:21 AM
Those curly quotes are the devil. God knows why Apple use them as standard.
Feb 13, 2019 12:08 PM
It is not curly quotes. I checked that. It was formatted that way by this form. I am using strait quotes and it isn’t working.
Feb 13, 2019 12:11 PM
Here is the screen shot.
Feb 13, 2019 12:30 PM
Well now youre missing the closing quote after Wednesday
Feb 13, 2019 12:55 PM
Got it! Thanks so much! Here is the final working formula in case someone needs it. I actually had to go in and pick the functions out of the list. For some reason copy and paste isn’t great for making functions.
IF(WEEKDAY(TODAY())=1,“Monday”, IF(WEEKDAY(TODAY())=2,“Tuesday”, IF(WEEKDAY(TODAY())=3,“Wednesday”, IF(WEEKDAY(TODAY())=4,“Thursday”, IF(WEEKDAY(TODAY())=5,“Friday”, IF(WEEKDAY(TODAY())=6,“Saturday”, IF(WEEKDAY(TODAY())=7,“Sunday”,“Date Error”)))))))
Feb 15, 2019 03:48 PM
You could make this a little more compact by using SWITCH instead. I recently did something similar where I needed to convert from the numeric value returned by MONTHS into the abbreviated month name. Here’s how I’d structure it in your case for the weekdays:
SWITCH(WEEKDAY(TODAY()), 1, "Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday",
5, "Friday", 6, "Saturday", 7, "Sunday", "Date Error")
Feb 16, 2019 02:14 AM
Thanks so much! I was actually looking for a SWITCH or CASE statement to work with and only found the nested IF.
Oct 31, 2020 08:21 AM
Thanks for the curly quotes tip, that really helped!