Or Statement?

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

Hello,

Frank. you helped me earlier on a formula and maybe you
can help me on this one too. I am thinking that I need
to have something equivalent to an "OR" statement but I
dont know of one.

I have a formula =
=IF(AND(AA16=5,AB16=10),AH16*19/55,IF(AND
(AA16=5,F16=20),AH16*74/210, IF(AND
(AA16=4,AB16=8),AH16*15/36,IF(AND
(AA16=4,AB16=16),AH16*58/136))))

This formula only works if the cells AA16=5 and AB16=10.
If those two cells are any of the other values in the
formula then it returns "FALSE". I want it to calculate
and dont want it to return "FALSE". I am thiking there
has to be something equivalent to "OR" in this formula to
make it work if AA16 and AB16 are any other values
besides 5 and 10 (they could be 5 & 20 or 4 & 8 or 4 &
16).

Thank you
 
Hi Tony
you just have to add the last FALSE statement. What should the formula
return in these cases? a zero?.

try
=IF(AND(AA16=5,AB16=10),AH16*19/55,IF(AND
(AA16=5,F16=20),AH16*74/210, IF(AND
(AA16=4,AB16=8),AH16*15/36,IF(AND
(AA16=4,AB16=16),AH16*58/136,0))))
 
Hi Frank,

The formula should never return a zero. Those cells will
only be the values in the formula (5,10 or 5,20 or 4,8).
I tried the formula but it returned a 0. Maybe this type
of formula is not correct for what i want to do. Have
any other ideas?

thanks,
Tony
 
Hi Tony
you may explain what result you want if your existing aND conditions
are not met. What do you want to calculate in these cases?
 
Frank,

My conditions will always be met. There will never be a
case where the and conditions will be false. The cells
will always equal one of those conditions.

Regards,
Tony
 
Tony,

Some thoughts on your question.

=IF(AND(AA16=5,AB16=10),AH16*19/55,
IF(AND(AA16=5,F16=20),AH16*74/210, <- Have you
noticed that this has "F16=20" not "AB16=20"?!
IF(AND(AA16=4,AB16=8),AH16*15/36,
IF(AND(AA16=4,AB16=16),AH16*58/136,"Error")))) <- There was an open
FALSE result on this line. I have placed "Error", where the result should
go.


Perhaps your results in AA16 or AB16 are not exactly integers, i.e. you are
getting rounding problems.
Another alternative is that you have a text format for AA16 and/or AB16.


regards,

JohnI
 
Thank you, John. It was a mistake. I had changed the
worsheet around and made some changes to it and changed
the formula around and I made it work.

Tony

-----Original Message-----
Tony,

Some thoughts on your question.

=IF(AND(AA16=5,AB16=10),AH16*19/55,
IF(AND
(AA16=5,F16=20),AH16*74/210, <-
Have you
 
Back
Top