I must admit. I am horrible at logical functions. I am trying to compose a
formula that will return a value of "1" if number is greater than 1, less
than 4, greater than 949, and less than 991. Here is what I have now but it
is not working: =IF(AND(G7>0,G7<4,G7>949,G7<991),1,0)
Any help would be awesome!
You need to express what you want more clearly -- then you might find logical
functions easier.
You don't say if you want the number to meet all of the criteria, or any of the
criteria, or perhaps some pairs of the criteria.
There is no way a number can meet all those criteria simultaneously. So if
that's what you want, the formula is: 0
Also, your statement and formula disagree as to what you want to do with regard
to the number 1. Your statement is "number is greater than 1", whereas your
formula reads G7>0.
If you want a 1 if the number meets any one of those criteria, then you need
the OR function which will return a TRUE/FALSE if the number is:
greater than 1 OR
less than 4 OR
greater than 949 OR
less than 991
In other words, if the number meets and one of the criteria.
=OR(n>1,n<4,n>949,n<991)
IF you want a 1 or 0, you can just convert TRUE/FALSE to a number:
=--OR(n>1,n<4,n>949,n<991)
or use an IF statement:
=IF(OR(n>1,n<4,n>949,n<991),1,0)
IF you want something else, you need to be clear. And I believe that being
clear in your own head, will help with your difficulties with logical
functions.
--ron