+ Reply to Thread
Results 1 to 10 of 10

Extract two zip codes from one cell with lots of content

  1. #1
    Registered User
    Join Date
    05-26-2011
    Location
    orlando
    MS-Off Ver
    Excel 2007
    Posts
    6

    Extract two zip codes from one cell with lots of content

    Hi I am trying to pull two 6 digit numbers (zipcodes) out of one cell.
    My problem is that I have a lot of content in the cell (both numbers and text). The best way to identify the 6 digit numbers I want is that there is always the same statement before the first zip code "Pick-up at: "random city(length varies)", "random state(always two capital letters)6 digit number"
    There is always one space before the number and never any space behind the 6 digit number and the number is always only 6 digits.
    Example as follows "Pick-up at: MILFORD, OH 45150"

    The second 6 digit number will always have the statement "Deliver to: "random city(length varies)", "random state(always two capital letters)6 digit number"
    Example as follows: "Deliver to: WAUSEON, OH 43567"

    How can I extract these two 6 digit numbers into two other cells? I can provide samples or more detail. Thank you.
    Your help is greatly appreciated.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Extract two zip codes from one cell with lots of content

    Hello rtlloyd ,

    Welcome to the Forum!

    You should post your workbook. It will help answer any questions that arise and provide information needed for a solution.

    To Attach a File:
    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    05-26-2011
    Location
    orlando
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Extract two zip codes from one cell with lots of content

    Worksheet Sample attached.
    Attached Files Attached Files

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Extract two zip codes from one cell with lots of content

    Hello rtlloyd ,

    Thanks for the file. Not sure what to make of it. The only data I see is on "Sheet1" and it is all HTML code. How does this relate to your original question?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Extract two zip codes from one cell with lots of content

    Please Login or Register  to view this content.
    A4 and copied down: =rtlPickUp(C4)

    B4 and copied down: =rtlDeliver(C4)


    Please Login or Register  to view this content.
    Last edited by shg; 09-22-2012 at 04:14 PM.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    05-26-2011
    Location
    orlando
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Extract two zip codes from one cell with lots of content

    Hi Leith, thank you for the quick response. The content is being imported into the cell by RSS and HTML code is part of that. If you look into the cell just about midway through you'll see the content I want to extract.
    If there is a way to remove the HTML from the cell that is fine with me, I don't need it in this worksheet just comes as part of the RSS feed import.

  7. #7
    Registered User
    Join Date
    05-26-2011
    Location
    orlando
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Extract two zip codes from one cell with lots of content

    Thank you for the code shg, but in both A4 and B4 the result is "#NAME?"

  8. #8
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Extract two zip codes from one cell with lots of content

    Here's another way. Params are ExtractZip(Cell,String to look for,End of string) Pick-up at: MILFORD, OH 45150<BR>

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Please Login or Register  to view this content.
    Last edited by mike7952; 09-22-2012 at 04:19 PM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  9. #9
    Registered User
    Join Date
    05-26-2011
    Location
    orlando
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Extract two zip codes from one cell with lots of content

    Thank you Mike, trying it now.

  10. #10
    Registered User
    Join Date
    05-26-2011
    Location
    orlando
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Extract two zip codes from one cell with lots of content

    Mike this does work. Thank you very much.

    Thank you shg and Leith for your efforts as well.

+ 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.6.0 RC 1