View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Seeker Seeker is offline
external usenet poster
 
Posts: 137
Default incorrect output of if formula

Hi Bernard,
Thanks for your idea. Problems arised was nothing related to the decimal
places because I extract the figure before decimal for compariation.
Rgds

"Bernard Liengme" wrote:

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