problem with IF statement

W

wolfpack95

I am comparing two columns with a IF statement and returning "Yes" i
they're equal and "No" if they're not. However, I'm getting a "No" i
cases where the values are equal. The formula works correctly if
select each cell and press enter. However, my sheet is too long to d
this for every cell.

I believe this is due to concatenating/comparing two text columns and
have seen this issue before but I can't remember the remedy. Thanks fo
any help
 
S

Sandy Mann

wolfpack95,

The most likely reason for comparisons failing is that the values only look
the same but are very slightly different. For example if one cell has =1/9
and the other a constant of 0.111111 they will both look the same in the
cell but a test of =A1=A2 will return FALSE because 1/9 is 0.111 recurring.
The answer is to round the data before comparing it as in:

=ROUND(A1,6)=ROUND(A2,6)

--
HTH

Sandy
In Perth, the ancient capital of Scotland

[email protected]
[email protected] with @tiscali.co.uk
 
Top