View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
AHizon via OfficeKB.com AHizon via OfficeKB.com is offline
external usenet poster
 
Posts: 23
Default if formula with between value as a criteria

This formula works too. Thanks all for your help!

xlm wrote:
Hi AHizon

if you need the formula to only says "OK" when it's equal to each other or
when the difference is between 1 and -1, then that formula doesn't take into
account of your
requirement. if cell A2 = 1 and cell B2 =2 which give you -1, the result is
False
Unless I have made a wrong assumption, then I apologize

try this shorter formula, you need to change the cell's references to yours

=IF(OR((A2=B2),AND(A2-B2<=1,A2-B2=-1)),"ok","off by
$"&ROUND(A2-B2,0))

HTH
Great, that formula did it...Thanks so much!

[quoted text clipped - 11 lines]
between 1 and -1? Please let me know if there is a way to modify this
formula.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200812/1