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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

chef

Well-known Member
Joined
Jul 10, 2002
Messages
568
Office Version
  1. 365
  2. 2016
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
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
60,886
Office Version
  1. 365
Platform
  1. Windows
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,102
Messages
5,768,102
Members
425,454
Latest member
khoro

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