+ Reply to Thread
Results 1 to 13 of 13

Thread: how to automatically extract country name from address in excell 2007

  1. #1
    Registered User
    Join Date
    12-22-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    9

    how to automatically extract country name from address in excell 2007

    "School of Engineering, Swinburne University of Technology, Malaysia; Large Millimeter Telescope, National Institute for Astrophysics, Optics and Electronics, Mexico; School of Electronic, Electrical and Computer Engineering, University of Birmingham, United Kingdom; LG Electronics Institute of Technology, Seocho-Gu, Seoul 137-724, South Korea; School of Electrical Engineering and Computer Science, Seoul National University, Seoul 137-724, South Korea; School of Electrical and Electronics Engineering, Chung-Ang University, South Korea"

    i have problem here actually all of the word above are adress and each address separate by ";"..and all the words above are in one columns..i need to separate all of this..
    this is my sample of data.. there are about 7k-8k like this type of data, i need to make this in their category for example it need to be like this

    column1=department
    row1=School of Electrical Engineering and Computer Science

    column2=university
    row1column2=Seoul National University

    column3=country
    row1column3=South Korea
    Last edited by puissmisteri; 12-22-2011 at 08:16 AM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    1,974

    Re: how to automatically extract country name from address in excell 2007

    Two options come immediately to mind. One is a vba solution that will take me a few minutes to put together and will only be good if you are going to be re-using this solution over and over again. If this is a one-time problem then I would advise the following:

    1) Open the list in Microsoft Word
    2) Click on Ctrl + H (which will bring up the replace pop-up window)
    3) Find: "; " (without the quotation marks)
    4) Replace with: "^p" (again without the quotation marks)
    5) Save the file as a text file and open in Excel
    6) When opening using the delimiter as comma and it will separate the department, university, and country into three columns
    7) If they are all in one column then use the Text-to-Columns option under the Data Tab.

    Hope this helps.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,403

    Re: how to automatically extract country name from address in excell 2007

    Hi,

    Please confirm if first two commas will have only department
    after this will have university and
    after this will have Countrly
    always in each record.

    e.g., dep1, dep2, university, country

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey
    +919810929744
    dilipandey@gmail.com

  4. #4
    Registered User
    Join Date
    12-22-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    9

    Re: how to automatically extract country name from address in excell 2007

    thanks to all of you

    and yes sometimes there are 2 departments that occur in the data..

    this is the attachment of my sample data..actually i have try to do the tab delimiters using comma and semicolon but then the column went wrong which is sometimes university names goes into other columns..

    thank you to all of you..
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-22-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    9

    Re: how to automatically extract country name from address in excell 2007

    thanks to all of you

    and yes sometimes there are 2 departments that occur in the data..

    this is the attachment of my sample data..actually i have try to do the tab delimiters using comma and semicolon but then the column went wrong which is sometimes university names goes into other columns..

    thank you to all of you..

    Attached Files Attached Files

    File Type: xlsx adress.xlsx‎ (14.2 KB, 0 views)

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    1,974

    Re: how to automatically extract country name from address in excell 2007

    Hi,

    Your data is inconsistent and therefore any solution will require you to visually check each row to make sure it is correct. There is a very old saying "garbage in, garbage out". If the original data is inconsistent then the end results will be consistent.

    Is there a pattern that I am not seeing? If so, what it is it?

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  7. #7
    Registered User
    Join Date
    12-22-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    9

    Re: how to automatically extract country name from address in excell 2007

    yes the data is inconsistent..because it is a downloaded data and need to be visually check one by one..

    bcoz there are lots of data like this that need to be refined in a good way..its very tiring to check thousands of these one by one..i really appreciate if someone could help to make it easier for me..

    thanks for helping me..abousetta and DILIPandey

    best regards..

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    1,974

    Re: how to automatically extract country name from address in excell 2007

    Is the original data a text file or an excel sheet? If you could show us the original file and what you want to do with the inconsistencies then we should be able to help. For example, what do we do when there are two departments? Do you want to lines one for each department or how do you wan the data to appear.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  9. #9
    Registered User
    Join Date
    12-22-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    9

    Re: how to automatically extract country name from address in excell 2007

    thank you very much for your concern..
    actually the original data is in the excell file..and what i need to do is to separate column and after that,the department,university,country need to be counted.

    the data that i really need is only c1=department,c2=department2(if any,but mostly there are only 1),c3=university,c4=country.

    there will be exist all the postcode and others just ignore it. i'll uplaod the actual data here.
    Attached Files Attached Files

  10. #10
    Forum Guru Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,274

    Re: how to automatically extract country name from address in excell 2007

    The data you are getting is horribly laid out. Perhaps you can ask whoever it is that prepares those files to do so in a workable manner. As it is now, you may have to manually check and split your data. I couldn't even perform text to columns with that data. I can't imagine the code that would need to be written to perform the tasks you require. That's just my opinion and it may not be worth much in this regards.
    Please leave a message after the beep!

  11. #11
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,224

    Re: how to automatically extract country name from address in excell 2007

    I think these 3 formulas get you 98% of the way there, then you can eyeball your way through and fix the errant few.

    B2: =LEFT(A2, FIND(",", A2)-1)
    C2: =TRIM(MID(SUBSTITUTE(A2,",",REPT(" ",100)), 99, 100))
    D2: =TRIM(RIGHT(SUBSTITUTE(A2, ",", REPT(" ",100)), 100))

    Copy those three down.

    This is done after a TEXT TO COLUMNS on the semicolons split the data out into individual groups.
    Attached Files Attached Files
    Last edited by JBeaucaire; 12-23-2011 at 12:51 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  12. #12
    Forum Contributor
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    111

    Re: how to automatically extract country name from address in excell 2007

    Quote Originally Posted by Mordred View Post
    The data you are getting is horribly laid out. ... That's just my opinion ...
    Spot on, IMHO - just look at line 6225 for inconsistency.
    Cheers,
    Paul Edstein
    [MS MVP - Word]

  13. #13
    Registered User
    Join Date
    12-22-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    9

    Re: how to automatically extract country name from address in excell 2007

    sorry for a long time delay..im actually cannot get any internet connection in the village..thank you very much for all the help..now im trying to get it done with all the help..i really apreciate all of your help...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0