Solved

Excel Sorting of Text

Posted on 2013-10-23
10
199 Views
Last Modified: 2013-10-23
I imported a 14000 rows of data into an excel spreadsheet and want to sort by column A which has numbers anywhere from 3 digits like this: 019 and 5 digits like this:  47384.   Some have this too:  0003a.

I had to import this column as text so that excel wouldn't mangle all the data and leave my leading zero's alone (why on earth does it do this).

Anyways - I can't sort it now.  Custom sorts don't work either.  I tried to sort it like this; 000,111,222,333, etc all the way up to 99999.

Help.
0
Comment
Question by:chuckster_eh
  • 6
  • 4
10 Comments
 
LVL 23

Expert Comment

by:NBVC
Comment Utility
When you went to sort, did Excel ask if you want to sort text that looks like numbers as numbers?  Did you reply not to (ie sort text and numbers separately)?
0
 

Author Comment

by:chuckster_eh
Comment Utility
I said "Sort anything that looks like a number - as a number"
0
 

Author Comment

by:chuckster_eh
Comment Utility
But I have tried it both ways....
0
 

Author Comment

by:chuckster_eh
Comment Utility
It seems to be sorting according to the actual number itself and not the digits.  For example its currently sorting like this: 01889,019,01900

But I want it to sort like this:

019,01889,01900

I want the number of digits to be the first order of sorting, then the sequentially.
0
 
LVL 23

Expert Comment

by:NBVC
Comment Utility
If I enter those 3 numbers as text strings and sort, and say sort anything that looks like a number as a number... then it sorts them as you said you desire.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:chuckster_eh
Comment Utility
try adding a few more numbers,

019
00020
00047
00053
00059
00070
077

I want it to look like this
019
077
00020
00047
00053
00059
00070
0
 
LVL 23

Accepted Solution

by:
NBVC earned 350 total points
Comment Utility
Ok, how about you add a helper column that gets the length., then sort by that column first,.

so if data is in column E, use formula in F2:  =LEN(E2)  copied down.

Then select both columns, sort first by column F, ascending, then column E, ascending
0
 

Author Comment

by:chuckster_eh
Comment Utility
My data is in column A.  I made a column b and put in =LEN(A2).  First row is header data.

It doesn't do anything....just says =LEN(A2) in the cell.   I must be missing something.
0
 
LVL 23

Expert Comment

by:NBVC
Comment Utility
That means column B is formatted as TEXT.  Format the column as General, then go to B2, re-enter the formula and copy it down again.
0
 

Author Comment

by:chuckster_eh
Comment Utility
awesome.  that was great. thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now