Results 1 to 5 of 5

Split column before X numbers (as text) in cell

Threaded View

  1. #1
    Registered User
    Join Date
    11-28-2015
    Location
    Eindhoven, Netherlands
    MS-Off Ver
    2010
    Posts
    2

    Split column before X numbers (as text) in cell

    Hey all,

    Couldn't find a solution to this, hopefully somebody can help me out with the following problem.
    I have a list of data, of which one column is a bit messy.
    This column contains a lot of information as text; Company name, Address, Postal Code & Place.
    More specifically, the format in cells of these column is as follows (without the [] brackets):

    [Company name]#[Street name] [Housenumber][PostalCodeNumber] [PostalCodeLetters] [Place]

    An example of 3 cells in this column:

    Pharma A#Main street 1230000 ZZ New York
    Semicon 1#Cowstreet 551234 AB Tokyo
    Bakery Z#Sheepstreet 44039999 SS Amsterdam

    I want to isolate the postal codes and put the number part of it in a separate column, so I can filter geographically.
    The important part here is that the postal codes are all Dutch, all Dutch postal codes always have the following format: exactly 4 number + exactly 2 capital letters
    From the example above, the postal codes are therefore 0000 ZZ, 1234 AB & 9999 SS.
    So the goal is to get a new column including only the postal numbers (preferably without letters):

    0000
    1234
    9999

    The problem here of course, is that the housenumbers are right next to the numbers of the postal code without any space or other symbol as delimiter. The housenumbers in the example are 123, 55 & 4403.
    Since the column contains over 6000 cells, this is not doable manually.
    So we need to devise a function that somehow detects the last 4 numbers in the cell and splits it (or copies into a new column).
    I have been trying some, but can't work it out. Hopefully one of you can help!

    Thanks in advance!


    Edit 1: added example file, should clarify a lot

    Edit 2: I can manage to split the company name from the rest of the text using the # symbol as delimiter, problem is getting the rest done.

    Edit 3: Solved:

    Thanks for the help everyone!

    Solution 1 (oedelre) & 3 (sandy666) have a little problem that text to column by fixed width doesn't work. In my example the width of the string until the numbers were accidentally the same (I didn't notice or clarify), but in reality these strings can be extremely long or short. Otherwise they would work perfectly.
    Solution 2 (Tony Valko) has the problem that, because these text strings weren't always of equal length, it sometimes gave a string of text instead of the postal code back.
    So what I did was create 10 different functions (and columns) where I altered the function as such: =LEFT(MID(A3,SEARCH("X??? ?? ",A3),7),4) where X=0-9. Then I simply combined it back into one column.

    Not a universal solution to different problems like mine, but for me it works.
    Thanks again!
    Attached Files Attached Files
    Last edited by JMusch; 11-28-2015 at 05:33 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Split Cell text New Column
    By laxmanann in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2014, 07:32 AM
  2. [SOLVED] Split cell containing numbers and text
    By MATU70 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 03-23-2014, 04:12 AM
  3. [SOLVED] Delete text, split numbers to two cells and store as numbers
    By Steve_123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2014, 09:51 AM
  4. Split numbers and text from a single Cell
    By wong_lizzie in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-17-2012, 08:12 AM
  5. split numbers from text in cell
    By nicko54 in forum Excel General
    Replies: 4
    Last Post: 03-26-2009, 07:24 AM
  6. Split Excel Cell w/o Text-2-Column?
    By benkmann in forum Excel General
    Replies: 13
    Last Post: 05-12-2008, 06:26 AM
  7. Formula to split Text from Numbers in cell
    By John Ortt in forum Excel General
    Replies: 2
    Last Post: 06-07-2006, 06:35 AM

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