+ Reply to Thread
Results 1 to 10 of 10

Split cells postcode from address

  1. #1
    Registered User
    Join Date
    01-11-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Split cells postcode from address

    If I have an address in a cell is it possible to separate the postcode out into a different cell. Unfortunately there are no delimiters I can use from the standard list as the only thing in the address are spaces, but if I use space as a separator it splits up the address and the postcode into two cells. I will have up to 30000 addresses which is why I am hoping there is an answer

    Here is an example of what I have and I just want to seperate the postcode from the rest of the address

    eg Jo Blogss 123 The Lane Newcity NW12 4EE (one cell)

    Result I am looking for

    Jo Bloggs 123 The Lane Newcity (one cell) NW12 4EE (another cell)

    Thanks

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2407 Win 11 Home 64 Bit
    Posts
    24,097

    Re: Split cells postcode from address

    Is the post code always at the end of the cell string? Is it always 8 characters long including the space?

    If the above is true, then in Cell for Address type =LEFT(A1,(LEN(A1)-8))
    Cell for Post code type =RIGHT(A1,8)
    Last edited by alansidman; 09-09-2013 at 10:07 AM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Split cells postcode from address

    UK postcodes can be variable in length,

    Assuming data in A1 try this formula in C1 to get the postcode

    =TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",10)),20))

    and this one in B1 to get the rest of the address

    =TRIM(SUBSTITUTE(A1,C1,""))

    assumes there will always be a postcode.....
    Audere est facere

  4. #4
    Registered User
    Join Date
    01-11-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Split cells postcode from address

    Hi Always at the end of cell but sometimes 7 characters but as the 8th is a space this may work OK. I will givt it a try thanks

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Split cells postcode from address

    Data in A1

    In B1 enter

    =LEFT(A1,(LEN(A1)-9))

    In C1 Enter

    =RIGHT(A1,8)
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Split cells postcode from address

    Quote Originally Posted by dsthome View Post
    Hi Always at the end of cell but sometimes 7 characters but as the 8th is a space this may work OK. I will givt it a try thanks
    Don't know about your data but there are many UK postcodes which have only 6 characters (including the space), e.g. postcode for Anfield (football ground) is L4 0TH

  7. #7
    Registered User
    Join Date
    01-11-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Split cells postcode from address

    This works great apart from there appears to be a space at then end of all the addresses I was given. If I delete the space the formula works fine, anyway to take this into account?

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Split cells postcode from address

    Are you referring to my suggestion? If so try these versions instead

    =TRIM(RIGHT(SUBSTITUTE(LEFT(A1,LEN(A1)-1)," ",REPT(" ",10)),20))

    =TRIM(SUBSTITUTE(LEFT(A1,LEN(A1)-1),C1,""))

  9. #9
    Registered User
    Join Date
    01-11-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Split cells postcode from address

    Thank you very much daddylonglegs, sved me about a millikon hours of remedil work

  10. #10
    Registered User
    Join Date
    01-11-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Split cells postcode from address

    Quote Originally Posted by dsthome View Post
    Thank you very much daddylonglegs, saved me about a million hours of remedial work
    Thank you very much daddylonglegs, saved me about a million hours of remedial work, next task replace keyboard on laptop half the keys don't work very well.

+ 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. Split GB Postcode ranges in to rows!!!!
    By 2013boris in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-11-2013, 12:31 PM
  2. [SOLVED] Split postcode ranges into rows
    By 2013boris in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2013, 09:41 AM
  3. [SOLVED] Help needed trimming full postcode address to postcode sector.
    By Mikey7346 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 08-10-2012, 05:11 PM
  4. display address corresponding to postcode and house no
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-12-2010, 09:37 AM
  5. how to split address blocks across multiple cells
    By JoannaF in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-02-2006, 07:25 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