Reputation: 1589
I am working on an excel file, and i am trying to use a nested if formula to achieve what i would like.
i have two columns:
A B
condition is this: if the value in a2=a3, then check if the minus of b2 and b3 is certain value, and if it is, put a yes, else put a no. this will iterate till the end of the excel file.
so far here is what i have. not sure how to use the excel formulas. any help is much appreciated.
if(a2=a3,b2-b3=5 or b2-b3=-5 or b2-b3=20 or b2-b3=-20, "yes", "no")
Upvotes: 0
Views: 1911
Reputation: 46331
Possibly use ABS function here..
=IF(AND(A2=A3,OR(ABS(B2-B3)={5,20})),"yes","no")
Upvotes: 1
Reputation: 25555
This works:
=IF(A2=A3,IF(OR(B2-B3=5,B2-B3=-5,B2-B3=20,B2-B3=-20),"yes","no"),"no")
Upvotes: 2