Skip to main content

What am I doing wrong? IF / AND statement


I am monitoring a project. It has a field for due date (DUE) and a dropdown select field for status (STATUS). I would like to create a formula that would alert me if the Due Date has passed but the task STATUS is anything except “complete”. I am trying this formula but its not working:

IF(AND(IS_BEFORE({Due},TODAY(),STATUS!=complete),‘ :x: ’,‘ :white_check_mark: ’)

What am I doing wrong? Please help a newbie. Thank you in advance!

8 replies

ScottWorld
Forum|alt.badge.img+20
  • Brainy
  • 8735 replies
  • November 4, 2020

Try this:

IF(AND(IS_BEFORE({Due},TODAY()),STATUS!="complete"),"❌","✅")


  • Author
  • Participating Frequently
  • 7 replies
  • November 4, 2020

@scottworld - didn’t work :frowning: It marked all records with a past due date as problematic, including those that were complete. So it ignored the Status part


ScottWorld
Forum|alt.badge.img+20
  • Brainy
  • 8735 replies
  • November 4, 2020
Alex_Lidell wrote:

@scottworld - didn’t work :frowning: It marked all records with a past due date as problematic, including those that were complete. So it ignored the Status part


I forgot to change your single quotes to double quotes. I’ve edited it above.


  • Author
  • Participating Frequently
  • 7 replies
  • November 4, 2020
ScottWorld wrote:

I forgot to change your single quotes to double quotes. I’ve edited it above.


Same problem… I don’t for the life of me understand why its not taking the status into account.


ScottWorld
Forum|alt.badge.img+20
  • Brainy
  • 8735 replies
  • November 4, 2020
Alex_Lidell wrote:

Same problem… I don’t for the life of me understand why its not taking the status into account.


I would check the spelling of “complete”, including capitalization.


  • Author
  • Participating Frequently
  • 7 replies
  • November 4, 2020

YES!!! THAT worked!!! Thank you. I didn’t realize capitalization mattered. How did you know to use " instead of ’ in this case?


ScottWorld
Forum|alt.badge.img+20
  • Brainy
  • 8735 replies
  • November 4, 2020
Alex_Lidell wrote:

YES!!! THAT worked!!! Thank you. I didn’t realize capitalization mattered. How did you know to use " instead of ’ in this case?


You’re welcome! Airtable always expects " when referencing strings. Airtable only uses ' when the function specifically calls for it (for example, when using the DATETIME_FORMAT function).


kuovonne
Forum|alt.badge.img+17
  • Brainy
  • 5993 replies
  • November 4, 2020
ScottWorld wrote:

You’re welcome! Airtable always expects " when referencing strings. Airtable only uses ' when the function specifically calls for it (for example, when using the DATETIME_FORMAT function).


Airtable formulas can use either single or double quotes (' or ") in the same way as most programming languages. It is useful to alternate the quote type when you want to use a literal quote without having to escape it.


Reply