sorting data

cybertroy1

New Member
Joined
Jul 18, 2008
Messages
7
I have a column of 11,000 individual numbers, comprised of alpha and numeric characters. The 5th character of each number is either alpha or a hyphen. How can I enter an if then statement to separate these into groups?
 

Some videos you may like

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.

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115
Hi cybertroy and welcome to the board.

I'm not clear exactly what you want to do - do you want to separate the "5th character alpha" entries from the "5th character hyphen" entries ?

Or, maybe you want to split the first 4 characters in each entry from the characters after the 5th one ?

Or maybe something entirely different ?

Both of the first two can be done quite easily - can you confirm exactly what you want please ?

Good luck !
 

cybertroy1

New Member
Joined
Jul 18, 2008
Messages
7
this is an example of what I'm trying to do.

1160DOW
1224-001
2237-002
3345EX

I want to separate the 5th character alphas from the 5th character dashes. Make sense?
 

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115
Yes that makes sense, thanks.

Use a helper column to pull out the 5th character.
Perhaps something like this, assuming your data is in Column A starting on Row 1.

Code:
=if(mid(a1,5,1)="-","DASH","ALPHA")
and then sort your data using this column as the main sort key.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,461
Messages
5,596,276
Members
414,051
Latest member
tabecker

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
Top