PC Review


Reply
Thread Tools Rate Thread

Custom Sort Order - Wildcard?

 
 
Budget Programmer
Guest
Posts: n/a
 
      14th Aug 2008
Hello,
I'd like to sort a sheet based on an ID column, but have the order
customized. The first part of the ID would be customized, the last part (
after the period) would follow normal sort order.
Customer Order for first part of field:
MB
CL
RX
PV
CU

Each one of them has a period and ascending numbers after them. The list,
after it went through the customized sort would look something like this:
MB.01
MB.02
CL.01
CL.02
CL.03
RX.01
PV.01
CU.01
CU.99
I set up a customized list (Tools/Options/Custom Lists), but there doesn't
seem to be a wild-card feature. I used MB?, MB*, etc, but they don't seem to
work.
Is there a wild-card feature to Customized lists? Or is there another way
to do this? Ultimately, I would call this from Selection.Sort in a Macro.
Many Thanks for your help.
--
Programmer on Budget
 
Reply With Quote
 
 
 
 
FSt1
Guest
Posts: n/a
 
      15th Aug 2008
hi
what you want i think is beyound excels built in capabilities. but a helper
column is usually the answer to customs sorts.
add a blank column somewhere(far right usually)
if all you have is the 5 catagories posted, you could use this formula in
the helper column....
=IF(LEFT(G3,2)="MB",1&G3,IF(LEFT(G3,2)="CL",2&G3,IF(LEFT(G3,2)="RX",3&G3,IF(LEFT(G3,2)="PV",4&G3,IF(LEFT(G3,2)="CU",5&G3,0)))))
copy down.
it basicly puts a number value in front of the catagory in an order you
specify.
sort by the helper column.
if you have more than the catagories posted you could create a small table
off to the side like this...
MB 1
CL 2
RX 3
PV 4
CU 5

then use a vlookup formula like this in the helper column....
=VLOOKUP(LEFT(G4,2),$N$4:$O$8,2)&G4
copy down.
it would produce the same results as the if formula. a shorter formula but
it requires the lookup table.
sort by the helper column.
after the sort, you can delete the help column or hide it for future use.
your call.

regards
FSt1
"Budget Programmer" wrote:

> Hello,
> I'd like to sort a sheet based on an ID column, but have the order
> customized. The first part of the ID would be customized, the last part (
> after the period) would follow normal sort order.
> Customer Order for first part of field:
> MB
> CL
> RX
> PV
> CU
>
> Each one of them has a period and ascending numbers after them. The list,
> after it went through the customized sort would look something like this:
> MB.01
> MB.02
> CL.01
> CL.02
> CL.03
> RX.01
> PV.01
> CU.01
> CU.99
> I set up a customized list (Tools/Options/Custom Lists), but there doesn't
> seem to be a wild-card feature. I used MB?, MB*, etc, but they don't seem to
> work.
> Is there a wild-card feature to Customized lists? Or is there another way
> to do this? Ultimately, I would call this from Selection.Sort in a Macro.
> Many Thanks for your help.
> --
> Programmer on Budget

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Sort Order Steve C Microsoft Excel Programming 1 4th Mar 2008 07:34 PM
Custom sort order Billy Rogers Microsoft Access Queries 2 18th Jan 2008 10:16 PM
custom sort order =?Utf-8?B?c3diMzE3?= Microsoft Access Queries 5 14th Jun 2006 08:45 PM
Custom sort order =?Utf-8?B?UmFzdG8=?= Microsoft Word Document Management 4 24th Feb 2006 01:59 PM
custom sort order mike Microsoft Access VBA Modules 1 24th Feb 2004 06:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:41 AM.