How do I use the "if" and "round" function in the same formula ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a formula that reads =IF(I135-J135=0,"OK","ERROR")

I can see that the figures in cells I135 & J135 are identical so I should
get a return of "OK" but I get "ERROR" instead. Could be something to do
with rounding ? if so how do I amend the formula to cope with this. (Note, I
have the same formula on two other worksheets in the same workbook, and they
both work fine !)

any suggestions, greatly appreciated
 
If I135 and J135 were really identical you would not be getting "ERROR"
=(I135-J135)
will show you the difference that Excel is keying on.

How close do they need to be? Try something like
=IF(ABS(I135-J135)<0.001,"OK","ERROR")
Replace 0.001 with a suitably small number for your context.

Jerry
 
Jerry, thank you very much for your quick response, and your suggestion
worked. I guess I was getting hung up on using the round function and never
thought of using absolute number instead

Thanks again
Carl
:-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top