how to make sure two numbers are identical

  • Thread starter Thread starter Cindy Wang
  • Start date Start date
C

Cindy Wang

I tried to compare two lists with vlookup, but found out the two lists
of numbers are not identical, I used trim function but still did not
work. Is there a way to make two lists of number identical? Thanks,
 
I tried to compare two lists with vlookup, but found out the two lists
of numbers are not identical, I used trim function but still did not
work.  Is there a way to make two lists of number identical?   Thanks,

More explanation and sample data
 
Where did the list come from?

Internet site?

Perhaps the cells contain non-breaking spaces that TRIM won't handle?

Edit>Replace

What: Alt + 0160 (on the numpad)

With: nothing

Replace All


Gord
 
Per Cindy Wang:
I tried to compare two lists with vlookup, but found out the two lists
of numbers are not identical, I used trim function but still did not
work.

This is a stab in the dark bco the lack of specifics... but I've
had situations where apparently-equal numbers failed "IF X = Y"
tests because they were stored as floating-point numbers.

Bottom line with floating-point was something like the numbers
are not stored as predictably-precise values. Instead, storing
40 might give you 40 in one case, but 40.000000000000003 in
another case.

Somebody who knows more can probably explain this in
technically-correct terms, but the basic idea is that what you
see is not necessarily what you get.

Dunno from Trim()....
 
Good point to bring up Pete


Gord

Per Cindy Wang:

This is a stab in the dark bco the lack of specifics... but I've
had situations where apparently-equal numbers failed "IF X = Y"
tests because they were stored as floating-point numbers.

Bottom line with floating-point was something like the numbers
are not stored as predictably-precise values. Instead, storing
40 might give you 40 in one case, but 40.000000000000003 in
another case.

Somebody who knows more can probably explain this in
technically-correct terms, but the basic idea is that what you
see is not necessarily what you get.

Dunno from Trim()....
 
Gord Dibben used his keyboard to write :
Good point to bring up Pete


Gord

That's likely to be the case if the data is the result of a formula. If
it's imported data then it's likely to be text unless Excel converted
it to a number during import. If so then the result could easily be
something other than what was imported. Your original reply asks a very
important Q!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
Back
Top