Why???

Rob_010101

Board Regular
Joined
Jul 24, 2017
Messages
208
Office Version
  1. 365
Platform
  1. Windows
To say this drives me nuts is an understatement.. I have 250,000 odd rows of data to check. I want to see if the post code in Column H matches the post code in Column O.

1741820763680.png


There's no erroneous spaces, they're formatted the same (as text)....

This is a CONSTANT issue with excel and I have never been able to work out why it does this when the data is OBVIOUSLY the same.

Can anyone help?

Thanks
 
Cannot replicate your issue. Have you tried Trim on each column of data and then run your code?

Book4
ABC
1Post CodeAddress
2NN169PENN169PETRUE
3NN169PENN169PETRUE
4NN169PENN169PETRUE
5NN169PENN169PETRUE
6NN169PENN169PETRUE
7NN169PENN169PETRUE
Sheet1
Cell Formulas
RangeFormula
C2:C7C2=A2=B2
 
Upvote 0
This is a CONSTANT issue with excel and I have never been able to work out why it does this when the data is OBVIOUSLY the same.
I have never seen Excel report that are not equal when they are in 25 years of using it. There is a difference, but it might not be visible to the naked eye.

Can you check the length of each one, i.e.
Excel Formula:
=LEN(H2)
and
Excel Formula:
=LEN(K2)
Do they both return the same number?
Do they both return 7 or 8?

Also, does hitting the F9 key change anything?
 
Upvote 0
I have never seen Excel report that are not equal when they are in 25 years of using it. There is a difference, but it might not be visible to the naked eye.

Can you check the length of each one, i.e.
Excel Formula:
=LEN(H2)
and
Excel Formula:
=LEN(K2)
Do they both return the same number?
Do they both return 7 or 8?

Also, does hitting the F9 key change anything?
1741821455591.png


F9 does nothing

I have had this issue with excel repeatedly over the years. In previous versions, you used to be able to sort it by using text to columns but this seems to not work anymore
 
Upvote 0
Where is this data coming from?
Is it exported from another program, or downloaded from the Web?
That kind of data often has special characters which look like spaces, but are actually not (things like "non-breaking spaces").

So let's investigate the 5th character of each entry, which looks like a space.
What do these two formulas return?

Excel Formula:
=CODE(MID(H2,5,1))
and
Excel Formula:
=CODE(MID(K2,5,1))

This is a CONSTANT issue with excel and I have never been able to work out why it does this when the data is OBVIOUSLY the same.
That is only true when you are trying to compare numeric values with numbers entered as text (the numeric value of 1 is not the same as a literal text entry of 1).
Since you have a mixture of numbers and text in the same cell, this would not be an issue here.
Excel would not see any of them as valid numeric entries.
 
Upvote 0
Where is this data coming from?
Is it exported from another program, or downloaded from the Web?
That kind of data often has special characters which look like spaces, but are actually not (things like "non-breaking spaces").

So let's investigate the 5th character of each entry, which looks like a space.
What do these two formulas return?

Excel Formula:
=CODE(MID(H2,5,1))
and
Excel Formula:
=CODE(MID(K2,5,1))


That is only true when you are trying to compare numeric values with numbers entered as text (the numeric value of 1 is not the same as a literal text entry of 1).
Since you have a mixture of numbers and text in the same cell, this would not be an issue here.
Excel would not see any of them as valid numeric entries.
This is a download from the web which I was sent via email.

Where is this data coming from?
Is it exported from another program, or downloaded from the Web?
That kind of data often has special characters which look like spaces, but are actually not (things like "non-breaking spaces").

So let's investigate the 5th character of each entry, which looks like a space.
What do these two formulas return?

Excel Formula:
=CODE(MID(H2,5,1))
and
Excel Formula:
=CODE(MID(K2,5,1))


That is only true when you are trying to compare numeric values with numbers entered as text (the numeric value of 1 is not the same as a literal text entry of 1).
Since you have a mixture of numbers and text in the same cell, this would not be an issue here.
Excel would not see any of them as valid numeric entries.
Interesting, the formulas return
1741822002966.png
 
Upvote 0
This is a download from the web which I was sent via email.


Interesting, the formulas return
View attachment 123230
And there it is!

The characters is spaces 5 of each entry are different.
I see that on web downloads all the time.

ASCII character 160 is a special "no break space" (see Character set (128 - 255)).
A normal space is ASCII character 32.
So the values are not the same.

I am guessing only one of those columns came from the Web, and the other is something someone typed directly into Excel.
 
Upvote 0
And there it is!

The characters is spaces 5 of each entry are different.
I see that on web downloads all the time.

ASCII character 160 is a special "no break space" (see Character set (128 - 255)).
A normal space is ASCII character 32.
Ironically, just before your message popped up i deleted the "no break space" from column K and the formula worked...

How would I remove this no break space from all the data and replace it with a normal space? Copy and paste into find and replace?

Thanks
 
Upvote 0

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