how to make sure two numbers are identical

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,
 
D

Don Guillett

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
 
G

Gord Dibben

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
 
P

(PeteCresswell)

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()....
 
G

Gord Dibben

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()....
 
G

GS

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top