Match a County to a City found in an Address

ExcelBrent

New Member
Joined
Oct 17, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hey, I am looking for some guidance on how I might achieve the following:

I have a column (column H) of full addresses, for example:
1234 SW 80th Pl, Miami, FL 33331

On another sheet, I have a list of COUNTIES in column A, and CITY in column B.

COUNTYCITY
Palm Beach
Acacia Villas
AlachuaAlachua
OrangeAlafaya
JacksonAlford
Santa RosaAllentown

I am needing to search the contents of the full address for the CITY and return the COUNTY that the city is located in.

I am trying to end up with a column that has the COUNTY associated with the address, so I can copy and paste the column values into a "County" column on the same sheet with the addresses.

I can find it with:
Excel Formula:
=IF(ISNUMBER(SEARCH(B520,Sheet2!$H$2)),A520,"FALSE")

However, this results in a full column of "FALSE" except for the located CITY. The below image is the result using the example address above. Column C is all FALSE except for the row 520, result is "Miami-Dade" which is correct; CITY in address = Miami and COUNTY = Miami-Dade.
1666028545581.png

Then to get the next address I would have to go horizontal to the next column which then I would search the address in Sheet2!$H$3.
I feel like there is a better approach. Any assistance is appreciated!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
MrExcelPlayground13.xlsx
AB
1COUNTYCITY
2Palm BeachAcacia Villas
3AlachuaAlachua
4OrangeAlafaya
5JacksonAlford
6Santa RosaAllentown
7
8
9123 john street, Acacia Villas, FL 12345Palm Beach
10456 west street, Alachua, AK 99948Alachua
111600 Penn Avenue, Washington DC 33333No Match
1210-110 Harry Avenue, Allentown, PA 22222Santa Rosa
Sheet7
Cell Formulas
RangeFormula
B9:B12B9=IFERROR(FILTER($A$2:$A$6,NOT(ISERR(SEARCH($B$2:$B$6,A9)))),"No Match")
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,098
Members
453,021
Latest member
Justyna P

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