Retrieve letters before first number from string

illusionek

Board Regular
Joined
Jun 21, 2014
Messages
104
Hello

I work with postcodes in various formats ie SE7 7AB or SE7; M20 1AB or M20 etc

I would like to retrieve letters from the left appearing before first number. In the above it would be SE or M.

Any suggestions?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
How about

Excel 2013/2016
AB
1Postcodeabbr
2AL1 1HBAL
3B1 1ERB
4BA1 2XSBA
5DY10 2BBDY
6E1 0NXE
7EC1A 1YSEC
8EN1 1BLEN
9EX1 1LJEX
10FY1 1HDFY
11L1 9EAL
Data
Cell Formulas
RangeFormula
B2=IF(ISNUMBER(--MID(A2,2,1)),LEFT(A2,1),LEFT(A2,2))
 
Upvote 0
Try this formula: =MID(A2,1,MIN(IF(ISNUMBER(FIND({1,2,3,4,5,6,7,8,9,0},A2)),FIND({1,2,3,4,5,6,7,8,9,0},A2)))-1)
The value in A2 and the formula in B2.
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

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