Similar Looking Texts are Not The Same??

legalhustler

Well-known Member
Joined
Jun 5, 2014
Messages
1,191
Office Version
  1. 365
Platform
  1. Windows
I have the following similar looking text in two different sheets and trying to determine if they are the same. At face value they look the same but they are not and I am trying to determine why they are not the same. .

I used the following formula =Sheet1!B6=Sheet2!B6 and it returns a False.

They are both pasted as values, both have same number of characters (37), there are no extra spaces at the beginning or end, they are both text not number.

Sheet 1 (B6):
1011*-*Disb*Auth*-*Central*Off*Resrve

Sheet 2 (B6):
1011 - Disb Auth - Central Off Resrve

Can someone advise please.

Thanks.

Note: When I pasted the data for Sheet 1 and saved on here it automatically put the * *. I don't know where the asterisks are coming from. The data for both sheets are coming from two different systems.
 
Last edited:

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Lots of things look the same in excel... A non breaking space can look like a space etc....

Go through it character by character ....

Paste the following formula:
=CODE(MID($B$6,ROWS(A1:A$1),1))
into cell A1 or something and then copy down 37 rows... then compare that to the other sheet and find which ascii code is different.

Good luck,

CN.
 
Upvote 0
Put this in A1 and fill right 37 columns. When it says FALSE, you'll know where it's different:
=MID(Sheet1!$B$6,column(A1),1)=MID(Sheet2!$B$6,column(A1),1)
Then you can use =CODE(MID(Sheet1!$B$6,column(A1),1)) (for Sheet2 also) to see what the character really is. I'm going to guess you have a hard space vs a normal space - CHAR(160) vs CHAR(32)
 
Upvote 0
Lots of things look the same in excel... A non breaking space can look like a space etc....

Go through it character by character ....

Paste the following formula:
=CODE(MID($B$6,ROWS(A1:A$1),1))
into cell A1 or something and then copy down 37 rows... then compare that to the other sheet and find which ascii code is different.

Good luck,

CN.

I got 7 Falses when I compared both sheets after I ran your formula. The values for the seven are 32. That matches with the 7 asterisks (*) when I pasted the data here. How can I fix this?
 
Last edited:
Upvote 0
Put this in A1 and fill right 37 columns. When it says FALSE, you'll know where it's different:
=MID(Sheet1!$B$6,column(A1),1)=MID(Sheet2!$B$6,column(A1),1)
Then you can use =CODE(MID(Sheet1!$B$6,column(A1),1)) (for Sheet2 also) to see what the character really is. I'm going to guess you have a hard space vs a normal space - CHAR(160) vs CHAR(32)

I believe I am getting the Char 32 value. How can I fix this? Would prefer a macro that will fix this issue. Thanks.
 
Last edited:
Upvote 0
Char(32) is a normal space... what are you getting on the other sheet instead of 32?

I resolved this issue. I opened a different thread because I thought the topics were slightly different. One was to identify the issue and the other to fix the issue using VBA. The other sheet had code 160.

So I replaced code 32 with 160 so that both sheets had the same format using the following code:

Cells.Replace Chr(32), Chr(160), xlPart
 
Upvote 0
Yep... sounds about right... a Chr(160) is a non-breaking space... in HTML they use &NBSP a lot... and that translates to a Chr(160).
 
Upvote 0

Forum statistics

Threads
1,216,174
Messages
6,129,296
Members
449,498
Latest member
Lee_ray

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