Skip to main content

Nested IF Formula not working

  • February 13, 2019
  • 9 replies
  • 59 views

Forum|alt.badge.img+2

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

Kamille_Parks11
Forum|alt.badge.img+27

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.


Forum|alt.badge.img+14

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.


Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • February 13, 2019

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.


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.


Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • February 13, 2019

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.


Here is the screen shot.


Kamille_Parks11
Forum|alt.badge.img+27

Here is the screen shot.


Well now youre missing the closing quote after Wednesday


Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • February 13, 2019

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


Justin_Barrett
Forum|alt.badge.img+21

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

Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • February 16, 2019

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.


Forum|alt.badge.img+8
  • Known Participant
  • October 31, 2020

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.


Thanks for the curly quotes tip, that really helped!