+ Reply to Thread
Results 1 to 11 of 11

vlookup partial text in a given text string

  1. #1
    Registered User
    Join Date
    08-22-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2010
    Posts
    5

    vlookup partial text in a given text string

    Hello All!

    I've been looking all over the internet but I haven't found the answer to my excel challenge yet. Basically what formula I require can be best explained with this example:

    I have a row where I have adresses from all over the world. Like shown below:

    FILE1:
    Row 1
    No.76 Kexue Ave. Zhengzhou High&New Technology Industries Development Zone, Zhengzhou, 450001 - China
    478 Industrial Park Rd., Berlin, WI, 54956 - USA
    Paterson, NJ, 07524-1112 - USA

    (I highlighted the partI want to vlookup later in BOLD)
    I have a second file, a database, with all cities from all over the world and I want to vlookup values there according to the city. Here an extract of my file

    FILE2:
    Row 1 | Row 2 | Row 3
    Country | City | vlookup value I want
    China - Zhengzhou - x8555
    Germany - Berlin - b1858
    USA - Berlin - KVG
    USA - Paterson - 23213
    USA - New York - ZHB
    ...

    So basically what I need to do is vlookup the city in that cell that contains plenty of other information like zip codes etc.
    My formula was:

    =VLOOKUP("*"&A1&"*";Table in File 2;3;false)

    Somehow this doesnt work?!

    Second challenge is that city names are not unique, as you can see it with the example of "Berlin". I guess I could need to add the country code and combine it with the city, then lookup that value like:

    USA-478 Industrial Park Rd., Berlin, WI, 54956 - USA

    I hope my explanation was accurate enough... Do not hesitate to ask questions


    Last but not least Text to column in FILE 1 is not and option (to isolate the city) because the setup for every country is diffrent and I have 200 diffrent countries...

    Thanks very much!!

    regards

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,540

    Re: vlookup partial text in a given text string

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Registered User
    Join Date
    08-22-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: vlookup partial text in a given text string

    I am sorry, I don't get your reply and don't understand what it has to do with my mentionned challenge..?

    Thanks for clarifying,

    Regards

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,540

    Re: vlookup partial text in a given text string

    Please post a sample sheet. I'd rather not have to re-type data for testing purposes - Thx

  5. #5
    Registered User
    Join Date
    08-22-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: vlookup partial text in a given text string

    Hi again,

    Oh I am sorry I completely misundertood. Sure, see attached file, it should be more clear now.

    Thanks for you help.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-15-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: vlookup partial text in a given text string

    If the city name was always in a standardized place within the address (say, for example, immediately following the first comma) this would be quite easy to accomplish. However this doesn't seem to be the case. Are there any other formats that the addresses are available in?

  7. #7
    Registered User
    Join Date
    08-15-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: vlookup partial text in a given text string

    Jeetheone,

    I have almost been able to accomplish what you are after. I started by isolating the individual words of the addresses. Unfortunately, it seems that (on occasion) street names are being muddled in with city names, causing incorrect vlookups to occur. Take a look at the attached spreadsheet to see what I mean. Let me know if that has helped you at all?
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: vlookup partial text in a given text string

    Hello, try this in C2 & copy down.

    =LOOKUP(9.9E+300,SEARCH(Database!B$3:B$36523,B2),Database!C$3:C$36523)
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  9. #9
    Registered User
    Join Date
    08-22-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: vlookup partial text in a given text string

    Hi Guys

    Thanks for your answers!
    @Tung74: Unfortunately no, the City is never in the same position... which would have made it too easy Your submitted file looks not bad, indeed that could be one approach. However I would need it to be match as close as 100% as possible.

    @Haseeb:
    What does your vlookup value refer 9.9E+300 to? SInce I dont use US excel I would need to translate this. Or would it be possible to insert your formula in the attached file?

    Many thanks guys this freaking problem is eating me up!!!

  10. #10
    Registered User
    Join Date
    08-15-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: vlookup partial text in a given text string

    What I would suggest is to then use my method, but take the output column, copy it, and paste as VALUES into an adjacent column. Then Ctrl+f "error" within the column and correct unknowns by hand. Viable?

  11. #11
    Registered User
    Join Date
    08-22-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: vlookup partial text in a given text string

    Hey Tung74,

    thanks very much for your suggestions but unfortunately I need to imperatively be able to read out the city out of one single cell, no matter the complexity of the text string.

    I am running out of ideas but I cant imagine that there is not such formula to vlookup only part of a text string.

    I welcome any other suggestions / answers.

    Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  2. Return Value Based On Partial Text String
    By JonnyBoy333 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-12-2011, 09:29 AM
  3. Index Match nesting w/ partial text string criteria
    By dohearn in forum Excel General
    Replies: 1
    Last Post: 10-25-2011, 03:42 PM
  4. Vlookup Partial Text String
    By dreicer_Jarr in forum Excel General
    Replies: 7
    Last Post: 05-26-2011, 09:23 PM
  5. Using a partial text string compared to a column with VLOOKUP
    By carolyn.brussee in forum Excel General
    Replies: 6
    Last Post: 11-18-2010, 12:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1