if cell A is +- 10% of cell B

T

tina

Hi
What is the best way to write if statement to show if cell A1 is 10% greater
or 10%smaller than cell B1
thanks
Pat
 
R

Roger Govier

Hi Tina

=IF(OR(A1>B1*(1+10%),A1<B1*(1-10%)),"Yes","No")

Note this excludes equal to +10% and -10% values themselves. Change > to
= to include these values.

Regards

Roger Govier
 
V

vezerid

Roger,

I believe the phrasing in Tina's request contains an OR, but what she
really means is

=IF(AND(A1<B1*(1+10%),A1>B1*(1-10%)),"Yes","No")

HTH
Kostis Vezerides
 
R

Roger Govier

Hi Kostis

Maybe.
The OP now has both solutions and can decide which suits her requirements.

Regards

Roger Govier
 
T

tina

Thank you Roger
I did mean "or" as trying to find out if a difference between 2 numbers is
greater than 10%
Thank you Kostis for your time
Tina
 
R

Roger Govier

Hi Tina

Thanks for the feedback. Seeing your request expressed that way, you
could use the shorter
=ABS(B1-A1)/B1=10% which will return TRUE or FALSE.

Regards

Roger Govier
 
F

Flojoe

this formula works great --- however, what if I want the yes to turn red and
the no to turn green what do I do? Thanks!
 
Top