Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Formatting Canadian Postal Codes.

Formatting Canadian Postal Codes

by Allen Wyatt
(last updated August 26, 2015)

4

In Canada, postal codes consist of six characters with a space in the middle: a letter, a number, a letter, a space, a number, a letter, and a final number. Thus, A1B 2C3 is a properly formatted postal code. If you are retrieving postal codes from an external database, they might not have the required space in the middle. Excel makes it easy to add such a space.

Let's assume that the improperly formatted postal codes are in column C. In column D you could use a formula such as the following:

=LEFT(B12,3) & " " & RIGHT(B12,3)

This formula uses string-manipulation functions to place a space in between the first and last three characters. Thus, if B12 contained A1B2C3, then the cell with this formula would display A1B 2C3.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (1931) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Formatting Canadian Postal Codes.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Controlling Where a Full-page Border is Printed

When you add full-page borders to your document, you may be bothered to find out that one or more sides of the border don't ...

Discover More

Tasks for Each Workbook

Excel allows you to control how it uses the Windows Taskbar. This tip explains the two ways Excel can use the Taskbar and how ...

Discover More

Limiting Directories in the FILENAME Field

When you use the FILENAME field in a document, it can include the full path name that leads to your file. This might be too ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

MORE EXCELTIPS (MENU)

Determining Winners, by Category

Do you need to determine the top three values in a range of columns? The techniques discussed in this tip will come in ...

Discover More

Determining Business Quarters from Dates

Many businesses organize information according to calendar quarters, especially when it comes to fiscal information. Given a ...

Discover More

Determining a Simple Moving Average

A moving average can be a great way to analyze a series of data points that you've collected over time. Setting up a formula ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments for this tip:

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven minus 6?

2017-01-18 17:55:14

Jim Foster

Did it another test and it does work
=LEFT(A1,3) & " " & RIGHT(A1,3)

That above works where the malformed zip is in cell A1 as a string of six number or six letters so my earlier test may have involved other factors to failure.

On the matter or REMOVING the space to create a string of six. The find and replace suggestion made below is correct.


2017-01-18 17:43:28

Jim Foster

That formula does not in fact work. It takes the FIRST TWO letters of the six and cuts the third off in the string of six


2015-03-05 10:40:20

Alicia

Pange, I would say the easiest way to do this would be to highlight your entire column and use find and replace. In the find box enter a space and in the replace box don't enter anything, click on replace all and you are done.


2015-01-23 13:44:21

Pange

Is there a way to do this in reverse? I have a list of Canadian postal codes with spaces but the system I'm uploading it to only allows me to import them without spaces.

Thanks!


Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.

Links and Sharing
Share