Numbers and Text in the same cell - Need to Seperate

bodazx

New Member
Joined
Jun 17, 2009
Messages
21
This is a problem I have seen too many times,

I have a spreadsheet with a list of SKUs, of varying character length, formatted as a mix of numbers and text. Many of the SKUs in this column are simple #s (eg 555002), but others have a letter or two added on to the end to indicate a slight variation (eg 555002c). I need to develop a sheet that vertically lists the base SKU #s, with the letter variants horizontally listed in columns to the right
Example:
555002 c
555003 d kz
555004
32105 vsc

The problem is that the SKUs are not all of the same length, nor are there a fixed number of letters on the end of each.

How can I seperate the numbers from the letters, when the cell is formatted all as "Text".
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Assuming data in A1

in B1
=1*MID(A1,MATCH(TRUE,ISNUMBER(1*MID(A1,ROW($1:$9),1)),0),COUNT(1*MID(A1,ROW($1:$9),1)))
Array formula, use Ctrl-Shift-Enter

in C1
=SUBSTITUTE(A1,B1,"")
copy down columns
 
Upvote 0
This is a problem I have seen too many times,

I have a spreadsheet with a list of SKUs, of varying character length, formatted as a mix of numbers and text. Many of the SKUs in this column are simple #s (eg 555002), but others have a letter or two added on to the end to indicate a slight variation (eg 555002c). I need to develop a sheet that vertically lists the base SKU #s, with the letter variants horizontally listed in columns to the right
Example:
555002 c
555003 d kz
555004
32105 vsc

The problem is that the SKUs are not all of the same length, nor are there a fixed number of letters on the end of each.

How can I seperate the numbers from the letters, when the cell is formatted all as "Text".
Assuming any letters are always after the numbers try this array formula (confirm with shift+control+enter - not just enter):
Code:
=LEFT(A1,SUM(IF(ISNUMBER(VALUE(LEFT(A1,ROW($1:$99)))),1,0)))
This will return the number as text even if it's a standalone number.
If you want to return it as a number, wrap the formula above in the VALUE function and enter with shift+control+enter.
 
Upvote 0
Can you please provide an explanation of how this works? I still don't quite understand array formulas.
 
Upvote 0
If there is always a space between the letters and numbers, you can try this to avoid an array formula:
Code:
=IFERROR(MID(A1,1,FIND(" ",A1)-1),A1)

IFERROR might be Excel 2007 or later. If you ar eusing an earlier version I think you need to use:
Code:
=IF(ISERROR(FIND(" ",A1)),A1,MID(A1,1,FIND(" ",A1)-1))
 
Upvote 0
I also need to pull the letter variations from data in another worksheet. For example, in sheet1, there may be 555003a, 55503c, 55503k, and in sheet2, I need to have (in seperate columns):
555003 a c k
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,029
Members
452,542
Latest member
Bricklin

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