PostCode Extraction data

Bravo2003

Active Member
Joined
Apr 1, 2010
Messages
278
Office Version
  1. 365
Platform
  1. Windows
Hi All,
This should be a simple one?

I'm currently using - =IF(D3="EXC","",LEFT(D3,2))

Column D being a list of postcodes.
works fine for most Postcodes, but the single letter ones - i.e Sheffield/S and Birmingham/B it add the number to it, obviously as i'm asking for the 2 characters in the formula.

Is there a way to make it not include numbers and just return either the 2 letter or 1 letter Postcode required?

Thanks

PS: - I actually reduced the formula to just - =LEFT(D3,2) as I don't need the IF part anymore.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hey try this:

Code:
IF(ISNUMBER(SEARCH(MID(D3,2,1),"0123456789")),LEFT(D3,1),LEFT(D3,2))

Or slightly shorter:

Code:
IF(ISNUMBER(VALUE(MID(D3,2,1))),LEFT(D3,1),LEFT(D3,2))
 
Last edited:
Upvote 0
Hey try this:

Code:
IF(ISNUMBER(SEARCH(MID(D3,2,1),"0123456789")),LEFT(D3,1),LEFT(D3,2))

Or slightly shorter:

Code:
IF(ISNUMBER(VALUE(MID(D3,2,1))),LEFT(D3,1),LEFT(D3,2))


Excellent, Thanks
Knew it would be a simple one.
 
Upvote 0
Or this:

Code:
=IF(ISNUMBER(--MID(D3,2,1)),LEFT(D3,1),LEFT(D3,2))
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,242
Members
452,623
Latest member
russelllowellpercy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top