#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Format of postcodes

I have a column in a worksheet populated with postcodes. These
postcodes are either 6-character or 7-character strings.

Eg:
AB19PQ
PE548YT

I would like the spacing to be altered, so that they appear like this:
AB 1 9PQ
PE54 8YT


How would I do this?

Any guidance gratefully received.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,069
Default Format of postcodes

one way put in =IF(LEN(A1)=7,LEFT(A1,4)&" "&(RIGHT(A1,3)),LEFT(A1,3)&"
"&(RIGHT(H5,3))) if the data is in cell A1
--
John
MOS Master Instructor Office 2000, 2002 & 2003
Please reply & rate any replies you get

Ice Hockey rules (especially the Wightlink Raiders)


"pseudonym" wrote:

I have a column in a worksheet populated with postcodes. These
postcodes are either 6-character or 7-character strings.

Eg:
AB19PQ
PE548YT

I would like the spacing to be altered, so that they appear like this:
AB 1 9PQ
PE54 8YT


How would I do this?

Any guidance gratefully received.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 182
Default Format of postcodes

John wrote on Thu, 3 May 2007 06:22:03 -0700:

J Ice Hockey rules (especially the Wightlink Raiders)

J "pseudonym" wrote:

?? I have a column in a worksheet populated with postcodes.
?? These postcodes are either 6-character or 7-character
?? strings.
??
?? Eg:
?? AB19PQ
?? PE548YT
??
?? I would like the spacing to be altered, so that they
?? appear like this: AB 1 9PQ PE54 8YT

British postcodes are complicated things (unnecessarily so,
IMHO)
http://www.royalmail.com/portal/rm/c...ediaId=9200078

A while ago, "daddylonglegs" (Fri, 3 Nov 2006 ) came up in this
ng with

" If postcode is in A1

=REPLACE(A1,LEN(A1)-2,0,REPT(" ",8-LEN(A1)))

this will even deal with possibilities you haven't listed like
L91AE (with no space)"

but the discussion went on for a long time to achieve a fully
comprehensive code.



James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.comcast.not

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Format of postcodes

Many thanks, this is closer to what I require, but the solution you
have offered does not quite meet with my needs.

=REPLACE(A1,LEN(A1)-2,0,REPT(" ",8-LEN(A1)))

gives the result:

Eg:
AB19PQ
PE548YT

Changes it to:
AB1 9PQ
PE54 8YT

The 7-digit postcode is spaced correctly, but I would like an extra
space to appear in the 6-digit postcode i.e. AB 1 9PQ


Any ideas

-----


On 3 May, 15:12, "James Silverton"
wrote:
John wrote on Thu, 3 May 2007 06:22:03 -0700:

J Ice Hockey rules (especially the Wightlink Raiders)

J "pseudonym" wrote:

?? I have a column in a worksheet populated with postcodes.
?? These postcodes are either 6-character or 7-character
?? strings.
??
?? Eg:
?? AB19PQ
?? PE548YT
??
?? I would like the spacing to be altered, so that they
?? appear like this: AB 1 9PQ PE54 8YT

British postcodes are complicated things (unnecessarily so,
IMHO)http://www.royalmail.com/portal/rm/c...ediaId=9200078

A while ago, "daddylonglegs" (Fri, 3 Nov 2006 ) came up in this
ng with

" If postcode is in A1

=REPLACE(A1,LEN(A1)-2,0,REPT(" ",8-LEN(A1)))

this will even deal with possibilities you haven't listed like
L91AE (with no space)"

but the discussion went on for a long time to achieve a fully
comprehensive code.

James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.comcast.not



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Postcodes starting with 0 fordrules01 Excel Discussion (Misc queries) 4 November 29th 06 08:32 AM
Standardising Postcodes dewheatley Excel Discussion (Misc queries) 19 November 8th 06 11:11 PM
Sorting UK Postcodes Aristobulus Excel Worksheet Functions 4 September 16th 06 04:51 PM
Postcodes PH NEWS Excel Worksheet Functions 6 May 5th 06 10:11 AM
Display a UK Map from excel list Postcodes Tonto Excel Discussion (Misc queries) 1 May 4th 06 07:54 PM


All times are GMT +1. The time now is 04:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"