Help

Re: Nested IF Formula not working

2953 0
cancel
Showing results for 
Search instead for 
Did you mean: 
William_Coron
5 - Automation Enthusiast
5 - Automation Enthusiast

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.

9 Replies 9

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.

Those curly quotes are the devil. God knows why Apple use them as standard.

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.

36%20PM Here is the screen shot.

Well now youre missing the closing quote after Wednesday

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”)))))))

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")

Thanks so much! I was actually looking for a SWITCH or CASE statement to work with and only found the nested IF.

Thanks for the curly quotes tip, that really helped!