Finding city name from address and retuning to adjacent cell

mountcleverest

New Member
Joined
Oct 10, 2014
Messages
3
Hi!,

I'm completely new to the forum and dunno if this is a no-brainer coz it has got me in a fix. I have a list of addresses from which I have to find the city name. For reference, I have a list of Indian cities.

Is there a formula to do this so that the city name is returned to the adjacent cells to the respective addresses?

Many Thanks in advance!

Cheers!

Mukesh
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi

It shouldn't be to hard. But you have to show an example of your data tables, with the expected results

Vidar
 
Upvote 0
Hi

It shouldn't be to hard. But you have to show an example of your data tables, with the expected results

Vidar

Hi!


Addresses City Name
176, Mall Road, Near Sbi, Ambala-133001Ambala
1-8-155, Near Paradise Circle, Beside Hdfc Bank, Pendergast Road, Secunderabad - 500003Secunderabad
19/1, First Floor, Sait Colony, 1St Street, Egmore, Chennai - 600008Chennai
41B, B Ganguli Street, 1St Floor, Central Plaza, Kolkata- 700047Kolkata
5, Park Road, Thapar House, Infront Of Civil Hospital, Hazratganj, Lucknow - 226001Lucknow
5/6, Aarsi Corner Building Nr. Gujarat College Ellis Bridge, Ahmedabad - 380009Ahmedabad
65-B, Rajpur Road, Dehradoon - 248001Dehradoon
9-8, Twin Towers, South Gandhi Maidan, Patna - 800001Patna
B-172, Bhrigu Marg, Bani Park, Jaipur - 302016Jaipur

<colgroup><col><col></colgroup><tbody>
</tbody>


The city names is an exhaustive list of Indian cities and is the reference for me.

Thanks!
 
Upvote 0
If E1:E15 has your list of cities and A1 has your address this works (entered CNTL-SHIFT-ENTER):

In B1:

=IFERROR(PROPER(INDEX($E$1:$E$15,MAX(IF(ISBLANK($E$1:$E$15),-1,IF(ISERROR(SEARCH($E$1:$E$15,A1)),-1,1)*ROW($E$1:$E$15))))),"City Not Found")
 
Upvote 0
If E1:E15 has your list of cities and A1 has your address this works (entered CNTL-SHIFT-ENTER):

In B1:

=IFERROR(PROPER(INDEX($E$1:$E$15,MAX(IF(ISBLANK($E$1:$E$15),-1,IF(ISERROR(SEARCH($E$1:$E$15,A1)),-1,1)*ROW($E$1:$E$15))))),"City Not Found")


Thanks a heap Steve! That really works. Forgive me please however, isn't there a shorter way to have this?

Cheers!
 
Upvote 0
Maybe this one?
=LOOKUP(9.99999999999999E+307,SEARCH("*"&$E$2:$E$10," *"&$A2&" "),$E$2:$E$10)

Adjust the ranges to your needs
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,688
Members
448,978
Latest member
rrauni

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