Re-ordering Rows

  • Thread starter Thread starter Bob Manjoney
  • Start date Start date
B

Bob Manjoney

I am using Excell 2003.

I have a range of cells that are sorted thusly

Col1 Col2 ... Coln
-------------------------
a ... ...
b ... ...
c ... ...
d ... ...
e ... ...

Where a,b,c,d,e is in the first column, and the remaining columns are
represented by the ellipsis.

Now, someone comes along and says - please re-order your table according to:

c, b, a, e, d (some arbitrary first column sort order).

Is there an easy way to apply an arbitrary ordering of the rows, given just
the desired order of the first column?

TIA,
Bob
 
Maybe you could define a custom list and use that as the key to sort.

Or maybe you could create a table (on another sheet) with the sort order in
column B and the keys in column A. Then use an =vlookup() formula to retrieve
that sort order value into a helper column and then sort the data by that helper
column.

In Sheet2:
A B
- -
a 3
b 2
c 1
d 5
e 4

And in that helper column, you'd have formulas like:
=vlookup(a1,sheet2!a:b,2,false)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top