Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Sorting numeric and alpha entries

I have a list that contains a field for road number. It sorts like the left
column, but I want it to look like the right column:

Road Number Road Number
2 1A
11 11
21 100
100 101
101 1000
200 10000
201 10000A
1000 2
10000 2A
10000A 2B
1A 200
2A 201
2B etc

I have formatted the data to be text, but that doesn't deliver the sort
order that I want. I am hoping that I can use formulas to do this, as I am
not familiar with VBA. Thanks in advance for your help.
--
Thanks, Allison
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Sorting numeric and alpha entries

What you need to do is add sufficient leading zeros to the numbers to
make them all the same length - you can do this in a helper column,
and then sort using the helper column as the sort field. After the
sort you can then delete the helper column, leaving the original Road
Number column unchanged.

If you want a formula to add the leading zeros, can you confirm:

a - the column where the Road Number data is
b - the first empty column in your data
c - the row containing the first Road Number
d - the number of rows used by the data
e - that you will only ever have a single letter after the number (eg
"A", "B" etc)

Hope this helps.

On Sep 26, 4:02 pm, Allison wrote:
I have a list that contains a field for road number. It sorts like the left
column, but I want it to look like the right column:

Road Number Road Number
2 1A
11 11
21 100
100 101
101 1000
200 10000
201 10000A
1000 2
10000 2A
10000A 2B
1A 200
2A 201
2B etc

I have formatted the data to be text, but that doesn't deliver the sort
order that I want. I am hoping that I can use formulas to do this, as I am
not familiar with VBA. Thanks in advance for your help.
--
Thanks, Allison



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Sorting numeric and alpha entries

Pete_UK:

Thanks for responding. I tried your suggestion manually on some test data,
and entered leading zeros so that the length of each road number was the same
number of characters. I sorted and ended up with the same result, eg, 0002,
0011, 0021, 001A. Am I missing something?
--
Thanks, Allison


"Pete_UK" wrote:

What you need to do is add sufficient leading zeros to the numbers to
make them all the same length - you can do this in a helper column,
and then sort using the helper column as the sort field. After the
sort you can then delete the helper column, leaving the original Road
Number column unchanged.

If you want a formula to add the leading zeros, can you confirm:

a - the column where the Road Number data is
b - the first empty column in your data
c - the row containing the first Road Number
d - the number of rows used by the data
e - that you will only ever have a single letter after the number (eg
"A", "B" etc)

Hope this helps.

On Sep 26, 4:02 pm, Allison wrote:
I have a list that contains a field for road number. It sorts like the left
column, but I want it to look like the right column:

Road Number Road Number
2 1A
11 11
21 100
100 101
101 1000
200 10000
201 10000A
1000 2
10000 2A
10000A 2B
1A 200
2A 201
2B etc

I have formatted the data to be text, but that doesn't deliver the sort
order that I want. I am hoping that I can use formulas to do this, as I am
not familiar with VBA. Thanks in advance for your help.
--
Thanks, Allison




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting Alpha-Numeric Values 69-er Charts and Charting in Excel 0 August 4th 06 01:50 PM
Sorting Cells With Alpha Numeric Values 69-er Charts and Charting in Excel 0 July 31st 06 06:27 PM
Sorting Alpha Numeric Part 2 CS Project Man Excel Discussion (Misc queries) 3 December 21st 05 06:56 PM
Sorting Alpha Numeric CS Project Man Excel Discussion (Misc queries) 2 December 21st 05 04:57 PM
Alpha-Numeric Sorting Jose Excel Discussion (Misc queries) 5 December 5th 05 09:51 PM


All times are GMT +1. The time now is 05:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"