Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Aug 29, 2021 12:23 AM
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?
Aug 29, 2021 02:01 AM
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'
)
Aug 29, 2021 02:37 AM
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.
Aug 29, 2021 02:56 AM
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.
Aug 29, 2021 03:20 AM
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.