You can use the OR function to check multiple values to see if they are true or false. The OR function by itself will only return "True" or "False". You can then add an IF statement to return a specific value.
Note: Only one of the statements being evaluated needs to be true because you’re checking one or the other. The AND function will return “True” only if both statements are true. You can also evaluate more that two values, just separate each with a comma.
Assume the value in A2 is 1, the following formula would return "True" because A2 is less than 100.
A2=1
=OR(A2>1,A2<100)
Result = True
Add an IF statement
A2=1
A3=100
=IF(OR(A2>1,A2<100),A3,"The value is out of range")
This formula returns a value of 100 because the statement is “True”. While it’s not >1 it is <100.
Can you tell me why the result on this one will never be "The value is out of range"?
Change the function to AND and you will get a different result if both are not true (basically if not between 1 and 100).
A2=1
A3=100
=IF(AND(A2>1,A2<100),A3,"The value is out of range")
This formula returns “The value is out of range” because both statements are not true. It is <100, and although it equals 1 it is not >1.