Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
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