In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Complex IF formula with AND/OR

insomned
8 - Asteroid

I have two columns, which I need to check are compatible. The first column has Y/N, and the other Agree/Disagree. With the formula, I added a new check column, to see which ones are compatible (ie have Y-Agree or N-Disagree) and which ones are not (for example have N-Agree). 

 

The IF formula I wrote is IF [AGR] = "Y" AND [Agreement] = "Agree" OR [AGR] = "N" AND [Agreement] = "Disagree" Then "Compatible" ELSE "Incompatible" ENDIF. 

 

This, however, works only for the second condition and returns the ones with Y-Agree as Incompatible. 

 

Suggestions how to fix this? Thanks a lot!! 🙂

2 REPLIES 2
Luke_C
17 - Castor
17 - Castor

Hi @insomned 

 

Put each clause in parenthesis and it should work. 

 

IF ([AGR] = "Y" AND [Agreement] = "Agree")

OR ([AGR] = "N" AND [Agreement] = "Disagree")

Then "Compatible"

ELSE "Incompatible"

ENDIF

 

Luke_C_0-1630352711902.png

 

insomned
8 - Asteroid

It worked, thank You so much!!! 🙂 

Labels
Top Solution Authors