+ Reply to Thread
Results 1 to 3 of 3

postcode

  1. #1
    flow23
    Guest

    postcode

    I am working with UK postcodes and need to strip out the area and district
    automatically

    The post code comes in following

    A1 2BC
    D34 5EF
    GH6 7IJ
    KL8M 9NQ


    The part before the space contains the area and district.

    The first is area which can be a single letter or double letter. The second
    bit is usually a single number, however in london it can be a number and
    letter.


    So the results would be as follows.

    A
    D
    GH
    KL

    How can I extract this automatically?

    Many thanks

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451
    With your example codes inrange A1:A4

    Type this in B1:
    =LEFT(A1,1)&IF(ISNUMBER(VALUE(MID(A1,2,1))),"",MID(A1,2,1))

    and drag copy down as far as is needed

  3. #3
    CLR
    Guest

    RE: postcode

    Maybe this...........

    =IF(ISNUMBER(MID(A1,2,1)*1),LEFT(A1,1),IF(ISNUMBER(MID(A1,3,1)*1),LEFT(A1,2),""))

    All on one line, watch out for word-wrap

    Vaya con Dios,
    Chuck, CABGx3


    "flow23" wrote:

    > I am working with UK postcodes and need to strip out the area and district
    > automatically
    >
    > The post code comes in following
    >
    > A1 2BC
    > D34 5EF
    > GH6 7IJ
    > KL8M 9NQ
    >
    >
    > The part before the space contains the area and district.
    >
    > The first is area which can be a single letter or double letter. The second
    > bit is usually a single number, however in london it can be a number and
    > letter.
    >
    >
    > So the results would be as follows.
    >
    > A
    > D
    > GH
    > KL
    >
    > How can I extract this automatically?
    >
    > Many thanks


+ 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