View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Mark Lincoln Mark Lincoln is offline
external usenet poster
 
Posts: 227
Default Failed Comparison... why?

You mentioned that both cells in question are formatted as Text, but
when I have two absolutely identical numbers that don't evaluate as
being equal it's always a case one cell formatted as Text versus one
that is not. Does the database import manage to change the formatting
of that cell? Or is Excel somehow treating it as a number regardless
of the formatting?

Mark Lincoln

On Dec 4, 3:13 pm, shelfish wrote:
Worksheet one....

Cell A1 contains formula: if(B1 = Sheet2!A1), "Yeah!", "Damn!")

Cell B1 contains a concatenation of C1 and D1, a model number and
serial number (ex. 141565). This number was generate by a macro, so
there is no formula in the cell, just the value.

Worksheet two is a database export and A1 DOES contain the same value.
I have verified there are not any leading or trailing spaces and made
sure that the cell format was the same for both...text.

But the formula returns false for some reason.

If I retype the value generated by the macro and hit enter, then it
will return true. If I replace the macro-generated value with a
concatenate formula, it also seems to work just fine. But this is not
an option for me due to the amount of IF statements needed to
correctly pair the model/serial numbers so that they match the values
in sheet 2

Any thoughts on what Excel quirk would cause it to see these two
values as unequal?

Many thanks,
S.