Determining The Difference Between Two Text Strings That Look Alike

MikeG

Well-known Member
Joined
Jul 4, 2004
Messages
845
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have imported some data into Excel and in some cases I have two strings that look the same when displayed in my worksheet. However when I test if they are equal, I get "FALSE". Here is an example:

003-100886
003-100886

I have checked the length and they both come back with 10.

Does anyone know some other tests I can try?

What might be going on here - are there hidden things that Excel can never get to?

Thanks,

MikeG
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
In that particular case I would check that the fourth character has the same ASCII code. Also I would check that they look the same in the formula bar, since number formatting could have been applied.
 
Upvote 0
In that particular case I would check that the fourth character has the same ASCII code. Also I would check that they look the same in the formula bar, since number formatting could have been applied.

Thanks Andrew.

The fourth character looks the same in the bar, and is ASCII 45 for both.

However, I just did a formula that put a "" in front of each (using the formula type =""&B1) and then I got a TRUE return when testing if they are equal.

Hmmm
 
Upvote 0
That formula would convert a number to text, but do nothing to text. Do you want to put your workbook on a share like Box.com and post the URL so that I can take a look at it?
 
Upvote 0
The two strings in the workbook you sent me aren't the same:

[TABLE="width: 109"]
<TBODY>[TR]
[TD]003-100866</SPAN>[/TD]
[/TR]
[TR]
[TD]003-100886</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL></COLGROUP>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,224,315
Messages
6,177,847
Members
452,810
Latest member
jeffrey0409

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top