I need to develop a formula that will compare a value against 2 other values AND compare the same value against 2 other values and return a text value in the cell indicating, for instance, "GOOD" or "BAD", and there would be two such statements in the formula.
Example: IF A>B and <C, AND A>D and <E, OR A>F and <G, AND A>H and <I. If both are true: GOOD. If both are false: BAD.
I have tried applying some of the other solutions found in this forum, but I can't seem to get the formula right and I can't get a text value other than "True" or "False".
Any help is appreciated.
Thanks.
Last edited by chancellor; 02-16-2012 at 07:43 PM.
Something like:
=IF(OR(AND(A1>B1,A1<C1,A1>D1,A1<E),AND(A1>F1,A1<G1,A1>H1,<I1)),"GOOD","BAD")
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Thanks for the help. If I had correctly stated the conditions, it would probably work. I think the correct example would look like this:
IF A>C,A<D and B>F,B<G OR A>D,A<E and B>H,B<I, THEN "GO","NO-GO"
I think this is a more concise and accurate statement of the conditions. If it helps, this is a formula to determine whether the center of gravity in a loaded airplane is within limits. "A" represents computed gross weight, "B" represents computed center of gravity, "C" "D" "E" represent min/max weight limits and "F" "G" "H" "I" represent min/max CG limits at referenced weights. Within limits = "GO" and out of limits = "NO-GO". LIVES DEPEND ON THIS FORMULA BEING RIGHT 100% OF THE TIME
Your help is appreciated.
Rick
You need to be precise in your explanation as to what the AND and OR bits relate to. For example do you mean:
IF (A>C,A<D and B>F,B<G) OR (A>D,A<E and B>H,B<I), THEN "GO","NO-GO"
or
IF A>C,A<D and (B>F,B<G OR A>D,A<E) and B>H,B<I, THEN "GO","NO-GO"
or something else?
Good luck.
Thanks OnErrorGoto0. I believe your first statement is correct. These are two separate conditions, only one of which can be True and the condition is "GO". If neither are True, then "NO-GO".
It's a matter of re-arranging what I already gave you then:
=IF(OR(AND(A1>C1,A1<D1,B1>F1,B1<G1),AND(A1>D1,A1<E1,B1>H1,B1<I1)),"GOOD","BAD")
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Thanks, NBVC. That seems to work perfectly! I just can't get my mind around how the "AND" and "OR" functions work together. Again, thanks to everyone for all your help.
Rick
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks