Calculate IF with OR between two cells and a range of numbers

I just can’t figure this out. I want to figure out a value if a number in either of two cells meets a range of numbers. Example:

If A1 OR B1 = 1 thru 50 then 100 else 0
This is what I currently have:
=IF(OR(A1="1-350",B1="1-350"),35,0)

Any help, or suggestions?

2 Likes

Your description and your formula seem to be different; I’ll assume If A1 OR B1 = 1 thru 50 then 100 else 0 are the values you are working with.


To determine if a value in A1 is between say 1 and 50 you could use AND(A1>=1;A1<=50) which will return TRUE if the value in A1 is greater than or equal to 1 and less than or equal to 50. Similarly, for B1 AND(B1>=1;B1<=50)


Combining the two we could use OR(AND(A1>=1;A1<=50);AND(B1>=1;B1<=50)) to see if either A1 or B is in the range 1 to 50. I’ll leave the remainder of the formula as an exercise for the student.

Note that “1-350” as used in your sample formula above is a string, not a number.

4 Likes

Thank you! Yes, the first part of my question was merely an example to help explain my dilemma. The second part was the actual formula in my worksheet. I had tried several different variations and context and the string option was the last option I tried before requesting help. The one thing that I didn’t realize was that you could combine multiple statements within a formula (AND and OR). I previously trolled the web for answers to this very thing, but with no success. I just concluded that it wasn’t possible. By the way, your formula works perfectly!! Again, thank you!!

Thanks for help.