Help

Re: IF(OR()) formula rejected

1758 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Richard_Eddy1
5 - Automation Enthusiast
5 - Automation Enthusiast

This formula is being accepted in a field, and is working:

IF({NOTES}=“to June 2022”,“Yes”,“No”)

but both of these more elaborate versions are being rejected:

IF(OR({NOTES} = “to Dec 2021”, {NOTES} = “Life”, {NOTES} = “Prepaid 2022-2023”), ”Yes", “No”)

IF(
OR(
{NOTES} = “to June 2022”,
{NOTES} = “to Dec 2021”
),
”Yes”,
“No”
)

Can anyone enlighten me on what I am doing wrong please?

4 Replies 4

Hi @Richard_Eddy1 - the formulas seem OK to me (as in the structure is good). It might be an issue of formatted quotes - formulas need plain text not formatted text. This version works for me:

IF(
  OR({NOTES} = 'to Dec 2021', {NOTES} = 'Life', {NOTES} = 'Prepaid 2022-2023'),
  'Yes', 
  'No'
)
Richard_Eddy1
5 - Automation Enthusiast
5 - Automation Enthusiast

Thank you. It worked for me too, as did this expanded version. It seems that both single quotes and spaces after commas separating arguments in the OR() are critical:

IF(
OR({NOTES} = ‘to Dec 2021’, {NOTES} = ‘Life’, {NOTES} = ‘Prepaid 2022-2023’, {NOTES} = ‘to June 2022’),
‘Yes’,
‘No’
)

A great help. Thank you.

Great!

As a side note, spaces shouldn’t be an issue and both double quotes and single quotes will be OK too as long as they are not formatted. By formatted quotes I mean the curly quotes in your posts versus the plain text quotes of my post. For anything but the simplest formulas I often bring in a code editor like Atom as it makes the process of forming the quote a lot easier and errors are easier to spot. Quote marks will be unformatted too.

Richard_Eddy1
5 - Automation Enthusiast
5 - Automation Enthusiast

Ah-ha! Now I understand. For convenience, I had been using an app called Drafts on my Mac to create the code and hadn’t noticed the formatted quotes. That all makes sense and I will be careful in future.