Comparing zip codes to keep in a column

xtremekyter

New Member
Joined
Aug 9, 2021
Messages
30
Office Version
  1. 2019
Platform
  1. Windows
I have an excel spreadsheet with full addresses and also have a spreadsheet of zip codes to keep. I am trying to find an automated way to compare and highlight zip codes not on my list of keepers without having to do it manually as I have ove 11,000 records. I'm thinking it would be an "is not equal to" function but have never used that.Thanks in advance. Jeff
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
You'll have to store leading zero zip codes as text '01112

Assumes zip codes are at the end and may be extended nine-digit zips. This could be very simplified if you assume it's always a 5-digit zip at the end of the address

MrExcelPlayground6.xlsx
ABC
1AddressGood ZIPs
2123 Silly St 1111112345-1234
3456 first avenue 12345-123410036
4One Penn Plaza 1003690125
5100-10 fifth avenue 1113391111
6Beverly Hills Yes 9012501111
711 Jersey Street 01111
88 other street 51111
9
10
11
12
Sheet19
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A12Expression=NOT(OR(NOT(ISERR(SEARCH($C$2:$C$6,TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",25)),15)))))))textNO
 
Upvote 0
You'll have to store leading zero zip codes as text '01112

Assumes zip codes are at the end and may be extended nine-digit zips. This could be very simplified if you assume it's always a 5-digit zip at the end of the address

MrExcelPlayground6.xlsx
ABC
1AddressGood ZIPs
2123 Silly St 1111112345-1234
3456 first avenue 12345-123410036
4One Penn Plaza 1003690125
5100-10 fifth avenue 1113391111
6Beverly Hills Yes 9012501111
711 Jersey Street 01111
88 other street 51111
9
10
11
12
Sheet19
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A12Expression=NOT(OR(NOT(ISERR(SEARCH($C$2:$C$6,TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",25)),15)))))))textNO
Thank you for your reply. I may have misled you by saying full address. The address is Name / Address / City / State / Zip so the zip code of the original is in a column by itself.
 
Upvote 0
Still with the leading zero zips stored as text.

MrExcelPlayground6.xlsx
ABCDEFG
1NameAddressCityStateZipGood ZIPs
2Jamie123 aaaNew YorkNY1000112345-1234
3Fred234 vvvCityAAB12345-123410036
4Harry5466 fadsfaCityBCD1011190125
5John4 first stCityCEF1113391111
6Mary10-12 121 stCityDFG9012501111
7Sally94 fasdjklCityHI01111
8Kevin10 askdfjPlaceJK51111
Sheet19
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E2:E12Expression=NOT(OR(NOT(ISERR(SEARCH($G$2:$G$6,E2)))))textNO
 
Upvote 0
FirstLastAddressCityStZipCompare F to HKeep these zips in F and highlight zips to delete
Gavin E.Billingsley2279 Keaton Chase DrFleming IslandFL
32003​
32003​
Mason K.Bily596 Chivas CtOrange ParkFL
32073​
32004​
Sarah M.Bimson2344 Country Side DrFleming IslandFL
32003​
32006​
Erica M.Bingham1198 Lenda LnMiddleburgFL
32068​
32007​
Keith L.Bingham1727 Poplar DrOrange ParkFL
32073​
32030​
Elaina M.Birge2625 Kermit CtOrange ParkFL
32065​
32033​
Brock E.Bishop3322 Southern Oaks DrGreen Cove SpringsFL
32043​
32043​
John A. IVBishop800 Hickory Knolls DrGreen Cove SpringsFL
32043​
32044​
Sophie S.Bishop1361 Riviera DrGreen Cove SpringsFL
32043​
32050​
Jianna V.Bitterling2076 Belle Grove TrceFLEMING ISLANDFL
32003​
32058​
Chase A.Black3924 Great Falls LoopMiddleburgFL
32068​
32065​
Bryce G.Blair3950 Royal Pines DrOrange ParkFL
32065​
32067​
Kenneth L. IIIBlair1985 Sunshine CtMiddleburgFL
32068​
32068​
McKenzie A.Blauch533 Glendale LnOrange ParkFL
32065​
32073​
Ashley A.Blazek3064 Paddle Creek DrGreen Cove SpringsFL
32044​
Garrett D.Bleau920 Fleming StFleming IslandFL
32003​
Kohl L.Blevins1192 Orchard Oriole PlMiddleburgFL
32068​
Amilah M.Bobias333 Island View CirOrange ParkFL
32073​
Jesse G.Boesch612 Charter Oaks BlvdOrange ParkFL
32065​
Alyssa L.Bohannon109 Hercules Dr EOrange ParkFL
32073​
Aralyn B.Bolejack8070 Blazing Star RdMelroseFL
32666​
Gavin M.Bolsega1744 Eagle Watch DrFleming IslandFL
32003​
Anne E.Bolt1806 West Lake CtFleming IslandFL
32003​
Tabria C.Booker825 Stallion WayOrange ParkFL
32065​
Kishana L.Boone2040 Wells Rd #8HOrange ParkFL
32073​
Brendan M.Booth714 Eagle Cove DrFleming IslandFL
32003​
Cael W.Booth1463 Brangus RdMiddleburgFL
32068​
 
Upvote 0
MrExcelPlayground6.xlsx
ABCDEFGH
1FirstLastAddressCityStZipCompare F to HKeep these zips in F and highlight zips to delete
2Gavin E.Billingsley2279 Keaton Chase DrFleming IslandFL3200332003
3Mason K.Bily596 Chivas CtOrange ParkFL3207332004
4Sarah M.Bimson2344 Country Side DrFleming IslandFL3200332006
5Erica M.Bingham1198 Lenda LnMiddleburgFL3206832007
6Keith L.Bingham1727 Poplar DrOrange ParkFL3207332030
7Elaina M.Birge2625 Kermit CtOrange ParkFL3206532033
8Brock E.Bishop3322 Southern Oaks DrGreen Cove SpringsFL3204332043
9John A. IVBishop800 Hickory Knolls DrGreen Cove SpringsFL3204332044
10Sophie S.Bishop1361 Riviera DrGreen Cove SpringsFL3204332050
11Jianna V.Bitterling2076 Belle Grove TrceFLEMING ISLANDFL3200332058
12Chase A.Black3924 Great Falls LoopMiddleburgFL3206832065
13Bryce G.Blair3950 Royal Pines DrOrange ParkFL3206532067
14Kenneth L. IIIBlair1985 Sunshine CtMiddleburgFL3206832068
15McKenzie A.Blauch533 Glendale LnOrange ParkFL3206532073
16Ashley A.Blazek3064 Paddle Creek DrGreen Cove SpringsFL32044
17Garrett D.Bleau920 Fleming StFleming IslandFL32003
18Kohl L.Blevins1192 Orchard Oriole PlMiddleburgFL32068
19Amilah M.Bobias333 Island View CirOrange ParkFL32073
20Jesse G.Boesch612 Charter Oaks BlvdOrange ParkFL32065
21Alyssa L.Bohannon109 Hercules Dr EOrange ParkFL32073
22Aralyn B.Bolejack8070 Blazing Star RdMelroseFL32666
23Gavin M.Bolsega1744 Eagle Watch DrFleming IslandFL32003
24Anne E.Bolt1806 West Lake CtFleming IslandFL32003
25Tabria C.Booker825 Stallion WayOrange ParkFL32065
26Kishana L.Boone2040 Wells Rd #8HOrange ParkFL32073
27Brendan M.Booth714 Eagle Cove DrFleming IslandFL32003
28Cael W.Booth1463 Brangus RdMiddleburgFL32068
Sheet19
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F2:F28Expression=NOT(OR(NOT(ISERR(SEARCH($H$2:$H$15,F2)))))textNO
 
Upvote 0
Hi,

Another way:

Book3.xlsx
ABCDEFGH
1FirstLastAddressCityStZipCompare F to HKeep these zips in F and highlight zips to delete
2Gavin E.Billingsley2279 Keaton Chase DrFleming IslandFL3200332003
3Mason K.Bily596 Chivas CtOrange ParkFL3207332004
4Sarah M.Bimson2344 Country Side DrFleming IslandFL3200332006
5Erica M.Bingham1198 Lenda LnMiddleburgFL3206832007
6Keith L.Bingham1727 Poplar DrOrange ParkFL3207332030
7Elaina M.Birge2625 Kermit CtOrange ParkFL3206532033
8Brock E.Bishop3322 Southern Oaks DrGreen Cove SpringsFL3204332043
9John A. IVBishop800 Hickory Knolls DrGreen Cove SpringsFL3204332044
10Sophie S.Bishop1361 Riviera DrGreen Cove SpringsFL3204332050
11Jianna V.Bitterling2076 Belle Grove TrceFLEMING ISLANDFL3200332058
12Chase A.Black3924 Great Falls LoopMiddleburgFL3206832065
13Bryce G.Blair3950 Royal Pines DrOrange ParkFL3206532067
14Kenneth L. IIIBlair1985 Sunshine CtMiddleburgFL3206832068
15McKenzie A.Blauch533 Glendale LnOrange ParkFL3206532073
16Ashley A.Blazek3064 Paddle Creek DrGreen Cove SpringsFL32044
17Garrett D.Bleau920 Fleming StFleming IslandFL32003
18Kohl L.Blevins1192 Orchard Oriole PlMiddleburgFL32068
19Amilah M.Bobias333 Island View CirOrange ParkFL32073
20Jesse G.Boesch612 Charter Oaks BlvdOrange ParkFL32065
21Alyssa L.Bohannon109 Hercules Dr EOrange ParkFL32073
22Aralyn B.Bolejack8070 Blazing Star RdMelroseFL32666
23Gavin M.Bolsega1744 Eagle Watch DrFleming IslandFL32003
24Anne E.Bolt1806 West Lake CtFleming IslandFL32003
25Tabria C.Booker825 Stallion WayOrange ParkFL32065
26Kishana L.Boone2040 Wells Rd #8HOrange ParkFL32073
27Brendan M.Booth714 Eagle Cove DrFleming IslandFL32003
28Cael W.Booth1463 Brangus RdMiddleburgFL32068
Sheet939
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F2:F28Expression=COUNTIF(H$2:H$15,F2)=0textNO
 
Upvote 0
Solution
Hi,

Another way:

Book3.xlsx
ABCDEFGH
1FirstLastAddressCityStZipCompare F to HKeep these zips in F and highlight zips to delete
2Gavin E.Billingsley2279 Keaton Chase DrFleming IslandFL3200332003
3Mason K.Bily596 Chivas CtOrange ParkFL3207332004
4Sarah M.Bimson2344 Country Side DrFleming IslandFL3200332006
5Erica M.Bingham1198 Lenda LnMiddleburgFL3206832007
6Keith L.Bingham1727 Poplar DrOrange ParkFL3207332030
7Elaina M.Birge2625 Kermit CtOrange ParkFL3206532033
8Brock E.Bishop3322 Southern Oaks DrGreen Cove SpringsFL3204332043
9John A. IVBishop800 Hickory Knolls DrGreen Cove SpringsFL3204332044
10Sophie S.Bishop1361 Riviera DrGreen Cove SpringsFL3204332050
11Jianna V.Bitterling2076 Belle Grove TrceFLEMING ISLANDFL3200332058
12Chase A.Black3924 Great Falls LoopMiddleburgFL3206832065
13Bryce G.Blair3950 Royal Pines DrOrange ParkFL3206532067
14Kenneth L. IIIBlair1985 Sunshine CtMiddleburgFL3206832068
15McKenzie A.Blauch533 Glendale LnOrange ParkFL3206532073
16Ashley A.Blazek3064 Paddle Creek DrGreen Cove SpringsFL32044
17Garrett D.Bleau920 Fleming StFleming IslandFL32003
18Kohl L.Blevins1192 Orchard Oriole PlMiddleburgFL32068
19Amilah M.Bobias333 Island View CirOrange ParkFL32073
20Jesse G.Boesch612 Charter Oaks BlvdOrange ParkFL32065
21Alyssa L.Bohannon109 Hercules Dr EOrange ParkFL32073
22Aralyn B.Bolejack8070 Blazing Star RdMelroseFL32666
23Gavin M.Bolsega1744 Eagle Watch DrFleming IslandFL32003
24Anne E.Bolt1806 West Lake CtFleming IslandFL32003
25Tabria C.Booker825 Stallion WayOrange ParkFL32065
26Kishana L.Boone2040 Wells Rd #8HOrange ParkFL32073
27Brendan M.Booth714 Eagle Cove DrFleming IslandFL32003
28Cael W.Booth1463 Brangus RdMiddleburgFL32068
Sheet939
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F2:F28Expression=COUNTIF(H$2:H$15,F2)=0textNO
Thank you but I am not too familiar with the conditional formatting tool. Where would I put that expression? Thanks again.
 
Upvote 0
MrExcelPlayground6.xlsx
ABCDEFGH
1FirstLastAddressCityStZipCompare F to HKeep these zips in F and highlight zips to delete
2Gavin E.Billingsley2279 Keaton Chase DrFleming IslandFL3200332003
3Mason K.Bily596 Chivas CtOrange ParkFL3207332004
4Sarah M.Bimson2344 Country Side DrFleming IslandFL3200332006
5Erica M.Bingham1198 Lenda LnMiddleburgFL3206832007
6Keith L.Bingham1727 Poplar DrOrange ParkFL3207332030
7Elaina M.Birge2625 Kermit CtOrange ParkFL3206532033
8Brock E.Bishop3322 Southern Oaks DrGreen Cove SpringsFL3204332043
9John A. IVBishop800 Hickory Knolls DrGreen Cove SpringsFL3204332044
10Sophie S.Bishop1361 Riviera DrGreen Cove SpringsFL3204332050
11Jianna V.Bitterling2076 Belle Grove TrceFLEMING ISLANDFL3200332058
12Chase A.Black3924 Great Falls LoopMiddleburgFL3206832065
13Bryce G.Blair3950 Royal Pines DrOrange ParkFL3206532067
14Kenneth L. IIIBlair1985 Sunshine CtMiddleburgFL3206832068
15McKenzie A.Blauch533 Glendale LnOrange ParkFL3206532073
16Ashley A.Blazek3064 Paddle Creek DrGreen Cove SpringsFL32044
17Garrett D.Bleau920 Fleming StFleming IslandFL32003
18Kohl L.Blevins1192 Orchard Oriole PlMiddleburgFL32068
19Amilah M.Bobias333 Island View CirOrange ParkFL32073
20Jesse G.Boesch612 Charter Oaks BlvdOrange ParkFL32065
21Alyssa L.Bohannon109 Hercules Dr EOrange ParkFL32073
22Aralyn B.Bolejack8070 Blazing Star RdMelroseFL32666
23Gavin M.Bolsega1744 Eagle Watch DrFleming IslandFL32003
24Anne E.Bolt1806 West Lake CtFleming IslandFL32003
25Tabria C.Booker825 Stallion WayOrange ParkFL32065
26Kishana L.Boone2040 Wells Rd #8HOrange ParkFL32073
27Brendan M.Booth714 Eagle Cove DrFleming IslandFL32003
28Cael W.Booth1463 Brangus RdMiddleburgFL32068
Sheet19
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F2:F28Expression=NOT(OR(NOT(ISERR(SEARCH($H$2:$H$15,F2)))))textNO
Thank you but I am not too familiar with the conditional formatting tool. Where would I put that expression? Thanks again.
 
Upvote 0
Thank you but I am not too familiar with the conditional formatting tool. Where would I put that expression? Thanks again.

Select Column F or the Column F range you need>
From Excel "Home" tab, Click "Conditional Formatting">
"New Rule">"Use a formula to determine which cells to format">
Enter my formula in Formula box>Click "Format">
Select "Fill", select fill color of your choice, click OK
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,655
Members
448,975
Latest member
sweeberry

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