Custom Sort Problem, Please Help!!!!!!!

Jack_58

Board Regular
Joined
Dec 3, 2002
Messages
208
I have the following spreadseet I need to be able to sort Column A by the following,
R, G, P, O, F, Q, X, A
2004-01.xls
ABCDEFGH
7ServiceLevelCalculationsforthePriorMonthbyInventoryClassCode
8MonthEnding:January-04
9ClassDescriptionTotal Active OrderedTotal Lines ShippedWarehouse Lines OutManuf Lines OutRaw Service LineAdjusted Service Line
10AAHSCREPACK8560882517138295396.3999.84
11FFAMILYPHCYPRIVATELABEL137626131111675584095.2799.51
12GGENERICITEMS42526438393442253710590.2899.01
13OOTC/HBA167452014845602689016307088.6698.39
14PPROGENERICSITEM1161920112718425013223597.0199.78
15QBRITELIFE1688013030703314777.1995.84
16RPHARMACEUTICAL277749025409462213621440891.4899.20
17XGOODNEIGHBORPHARMACY(GNP)45552928115151264.2897.48
AAS


Any help in this matter would be helpful!



Thanks



Jack
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
hi jack,

You could insert a column....column header class2...and against each class you could have 1 against each R..2 against each G....3 against each P etc etc..then Data Sort on Column class2..this will put them in the order you want..

If you have a large worksheet..set up a lookup table that will do the same thing.....hide the column...

Hope this helps
Chef
 
Upvote 0
Here is one way. Create a two column look-up table somewhere on your spreadsheet which indicates the sort order of these variables, i.e.:

Code:
R	1
G	2
P	3
O	4
F	5
Q	6
X	7
A	8

Now highlight the table range and name it, via Insert | Name | Define. For example sake, let's name it MyRange.

Now in your data, insert another column next to your codes and enter a VLOOKUP formula. For example, if you inserted a blank column B, then for your first entry in A10, enter this formula in B10:

=VLOOKUP(A10,MyRange,2,False)

This will return a value of 8. Copy this VLOOKUP formula down for all your entries.

You can now use this resulting column as your main sorting column. If you do not want to see this column, simply hide it when you are finished.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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