Formula/conditional formatting to highlight mismatching postcodes

maxim642

Board Regular
Joined
Feb 4, 2021
Messages
91
Office Version
  1. 365
Platform
  1. MacOS
Below is an example of my dataset. In the 3rd column, I'd like to have a formula that tells me whether columns 1 & 2 contain the same text (TRUE), or not (FALSE). The issue I'm struggling with is accounting for spaces between the text. So, the first row should count as a match as spaces don't affect the actual postcode, it's just how someone has formatted it when uploading the data (columns 1 & 2 are coming from different sources).

As long as the first 2 columns contain the same letters (ignore spaces), it should be "TRUE", otherwise "FALSE".

Thanks.

AB11 2XYAB112XYTRUE
D114PDD115TYFALSE
MK45 6ptmk456PTTRUE
 
Last edited:

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Book1
ABCDE
1AB11 2XYAB112XYTRUETRUE
2D114PDD115TYFALSEFALSE
3MK45 6ptmk456PTTRUETRUE
Sheet1
Cell Formulas
RangeFormula
E1:E3E1=B1=SUBSTITUTE(A1," ","")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B1:B3Expression=NOT($B1=SUBSTITUTE($A1," ",""))textNO
 
Upvote 0
YM Addresses 1.3.21.xlsx
ABCDEFGHIJK
212345MRJimTest99 CLOSECASTLEFIELDSSTAFFORDLEEDSST16 1AZst16 1azFALSE
312345MRJohnTest99 AVENUENORTHWICHCHESHIREBrightonCW9 8DUCw9 8duFALSE
Jan 21 CFH Add
Cell Formulas
RangeFormula
K2:K3K2=J2=SUBSTITUTE(I2," ","")
 
Upvote 0
Hi, thanks for the above suggestion, but it's still returning a "FALSE", where it should be "TRUE". Perhaps, I've adapted the formula incorrectly? I've uploaded another sample of my data sheet for reference.
 
Upvote 0
so you need it to be case sensitive ?
AND if Both have spaces within the text then they match up
can you give a few more examples, so we can see the possible entries and where a match is possible ?
 
Upvote 0
Sorry, I'm explaining it poorly I think.

It doesn't need to be case-sensitive. The last column just needs to confirm whether the previous 2 columns contain the same letters (spacing and case-type don't matter).

Below is an example of how it should look... (thanks for your help)....

YM Addresses 1.3.21.xlsx
ABCDEFGHIJK
112345MRjimsmith11 streetManchesterPrestonHouseST16 1AZST16 1DAFALSE
212345MRjohnsmith22 streetManchesterPrestonHouseCW98DUCW9 8DUTRUE
3234566MRjaysmith33 streetManchesterPrestonHouseWA51DA2WA51DAFALSE
42234555MRjacksmith44 streetManchesterPrestonHousePR5 2BUPR3 2BUFALSE
Sheet3
 
Upvote 0
If we remove any spaces and then compare - would that work?
=SUBSTITUTE(I5," ","")=SUBSTITUTE(J5," ","")


Book1
IJKL
4Formula
5ST16 1AZST16 1DAFALSEFALSE
6CW98DUCW9 8DUTRUETRUE
7WA51DA2WA51DAFALSEFALSE
8PR5 2BUPR3 2BUFALSEFALSE
Sheet2
Cell Formulas
RangeFormula
L5:L8L5=SUBSTITUTE(I5," ","")=SUBSTITUTE(J5," ","")
 
Upvote 0
Solution
If we remove any spaces and then compare - would that work?
=SUBSTITUTE(I5," ","")=SUBSTITUTE(J5," ","")


Book1
IJKL
4Formula
5ST16 1AZST16 1DAFALSEFALSE
6CW98DUCW9 8DUTRUETRUE
7WA51DA2WA51DAFALSEFALSE
8PR5 2BUPR3 2BUFALSEFALSE
Sheet2
Cell Formulas
RangeFormula
L5:L8L5=SUBSTITUTE(I5," ","")=SUBSTITUTE(J5," ","")
Thank you very much for helping. This worked!!! Have a great day.
 
Upvote 0

Forum statistics

Threads
1,214,797
Messages
6,121,629
Members
449,041
Latest member
Postman24

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