Extract key data from alpha/numeric string

isadoko

Active Member
Joined
Jan 10, 2005
Messages
322
Office Version
  1. 365
Platform
  1. Windows
OS: XP Pro
XL: 2002

Have long lists of combo alpha/numeric data, eg,

4015 PTC
Sellable Item
4017 PTJ Password
4017 PTJ Password
4017 PTJ Password
PTCollab
PTC
4021 PTJ Password
4015 PTC
4015 PTC

I want to extract the number code if present, and if no number code extract any text, and finally if field blank return "blank"

Thanks Much
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Here's one option,

=IF(ISNUMBER(VALUE(LEFT(A1,1))),LEFT(A1,FIND(" ",A1)),IF(A1="","",A1))
 
Upvote 0
NBVC your solution was on the mark--many thanks!
 
Upvote 0
Hi isadoko,

Actually, I should have included something in the formula to help ignore the space at the end of a the numeric string that is pulled with the Left/Find function.

Please change the formula to this: I added the "-1" in the Left/Find function.

=IF(ISNUMBER(VALUE(LEFT(A1,1))),LEFT(A1,FIND(" ",A1)-1),IF(A1="","",A1))

Thanks.
 
Upvote 0
Aladin Akyurek said:
=TRIM(LEFT(A2,SEARCH(" ",A2&" ")))

Using this formula, on the second item in the OP's list only the word "Sellable" comes up. I think the OP wants "Sellable Item"
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,742
Members
448,989
Latest member
mariah3

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