ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Postal code to Area translation (https://www.excelbanter.com/excel-worksheet-functions/447482-postal-code-area-translation.html)

idxearo

Postal code to Area translation
 
I have some postal codes all in one column.
eg EN1 7IH, and N1 M33

I want to create a column where excel reads the first characters BEFORE the space, since those characters represent an Area.

I want to be able to add the name of the postal code area in the new column. For example EN1 = Area1 and N1 = Area2

Kevin@Radstock

You will need to have a table set up in your work sheet with the post codes listed and a area allocated to each code, As in the UK there are over a hundred. Then you could use a LOOKUP or INDEX & MATCH etc.
EG: =VLOOKUP(LEFT(Cell/Ref,2),Your_Range,Column,0)

Quote:

Originally Posted by idxearo (Post 1606714)
I have some postal codes all in one column.
eg EN1 7IH, and N1 M33

I want to create a column where excel reads the first characters BEFORE the space, since those characters represent an Area.

I want to be able to add the name of the postal code area in the new column. For example EN1 = Area1 and N1 = Area2


idxearo

Quote:

Originally Posted by Kevin@Radstock (Post 1606715)
You will need to have a table set up in your work sheet with the post codes listed and a area allocated to each code, As in the UK there are over a hundred. Then you could use a LOOKUP or INDEX & MATCH etc.
EG: =VLOOKUP(LEFT(Cell/Ref,2),Your_Range,Column,0)

Thank you very much I will try and let you know how this goes.

Spencer101

Quote:

Originally Posted by idxearo (Post 1606752)
Thank you very much I will try and let you know how this goes.

The formula suggested above will only look up the left 2 characters in the post code cells. That means it will look for EN in the lookup table rather than EN1.

The below will look for all characters before the first space.

=VLOOKUP(LEFT(CellRef,FIND(" ",CellRef)-1),Range,Column,0)

Kevin@Radstock

EG = "EXAMPLE" !!

Quote:

Originally Posted by Spencer101 (Post 1606763)
The formula suggested above will only look up the left 2 characters in the post code cells. That means it will look for EN in the lookup table rather than EN1.

The below will look for all characters before the first space.

=VLOOKUP(LEFT(CellRef,FIND(" ",CellRef)-1),Range,Column,0)


Spencer101

Quote:

Originally Posted by Kevin@Radstock (Post 1606806)
EG = "EXAMPLE" !!


Yes, Kevin, I know what it means.

But your EG was not going to do what the OP needed, so I stepped in with a better EG.


All times are GMT +1. The time now is 10:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com