I am new to excel. I am trying to write a function with 3 conditions, but it does not work. Could you please help me to figure out what error I do?

=IF(AND(A1=1, ISBLANK(B1)),C1=1,IF(AND(A1=2, B1=1),C1=2,IF(AND(A1=2, B1=2),C1=0)))

What I am trying to say: if in column A value is 1 and column B is empty cell, then C should be 1, if column A is 2 and Coulmn B is 1, then C should be 2. Finally, if both columns are 2 then C should be 0.

Thank you for your time!!

=IF(AND(A1=1, ISBLANK(B1)),C1=1,IF(AND(A1=2, B1=1),C1=2,IF(AND(A1=2, B1=2),C1=0)))

What I am trying to say: if in column A value is 1 and column B is empty cell, then C should be 1, if column A is 2 and Coulmn B is 1, then C should be 2. Finally, if both columns are 2 then C should be 0.

Thank you for your time!!

Last edited: