postcode

G

Guest

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
 
G

Guest

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
 
C

Cutter

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 neede
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top