View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme[_3_] Bernard Liengme[_3_] is offline
external usenet poster
 
Posts: 1,104
Default incorrect output of if formula

Are you comparing real numbers (numbers with decimal places)?; if so, it is
possible they display the same but are very slightly different.
Try =if(ABS(A1-A2)<1E-10,"yes","no")
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"Seeker" wrote in message
...
I have two cells with values which were macro auto copied from other cells
by
copy - paste special - value, I have a =if(A1=A2,"yes","no") formula in
third
cell to compare these two cells. From time to time the output of formula
gives inccorrect answer, but if I copy the first cell to the second cell
again manually using copy - paste function, the third cell gives the right
answer. Any idea why and how to correct this please?
Rgds