0

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")

2 Answers 2

2

This works:

=IF(A2=A3,IF(OR(B2-B3=5,B2-B3=-5,B2-B3=20,B2-B3=-20),"yes","no"),"no")
Sign up to request clarification or add additional context in comments.

1 Comment

Alternatively, instead of using a nested IF, you could just use an AND: =IF(AND(A2=A3,OR(B2-B3=5,B2-B3=-5,B2-B3=20,B2-B3=-20)),"yes","no")
1

Possibly use ABS function here..

=IF(AND(A2=A3,OR(ABS(B2-B3)={5,20})),"yes","no")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.