简体   繁体   中英

IF formula returning 0 or 1 depending on values in 3 cells?

I'm a beginner in Excel and I've been trying to make an IF formula that will return 0 or 1 if certain conditions are met.

The formula in A3 must look at

  • A1 to see if A1=1111
  • A2 to see if A2=21,00
  • A2 to see if A2=24,00.

So, if A1=1111 and A2=21,00 or 24,00 the result in A3 must be 1, but if A1=1111 and A2 is any other value, A3 must be 0.
LE: If in other rows the value is 1112 the formula should return 1.

Yes, use and as well as or -

=IF(AND(A1=1111,OR(A2=21,A2=24))=TRUE,1,0)

Per comments, to add more arguments, just expand the first test for the and with an or -

=IF(AND(OR(B3=1111,B3=1112,B3=1113,B3=5555),OR(C3=21,C3=22.4))=TRUE,1,0)

update

=IF(B3<>1111,1,IF(AND(B3=1111,OR(C3=21,C3=22.4))=TRUE,1,0))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM