Sorting more than three columns

  • Thread starter Thread starter Jackie
  • Start date Start date
J

Jackie

Hi,

have a small problem, I am trying to sort a spreadsheet, but need to
sort it by four columns. I'm sure I've seen this done before, but
can't for the life of me see where to set this...

Any help would be appreciated.
 
Choose the range you wish to sort and then click on Data/Sort and then pick
the columns in the order you want them sorted.

Ken Russell
 
Another way is to make use of a temporary (helper) column where the
four fields are concatenated together, eg =A1 & B1 & C1 & D1. Then you
can sort on this one field.

If a field is numeric it is better to use the TEXT( ) function to
ensure that the same number of digits are used each time, e.g. =A1 &
TEXT(B1,"00000000") & C1 & D1.

It is also better to ensure that text fields are the same width, by
using the REPT( ) function.

So, in your helper column you may end up with a formula like:

=A1&REPT(" ",20-LEN(A1)) & TEXT(B1,"00000000") & C1&REPT("
",10-LEN(C1)) & D1

which makes the first field 20 characters wide, and the third field 10
characters wide - it doesn't matter about the final field. Copy this
down, sort on this field, then delete the helper column when not
required. Of course, you could still make use of the other two sort
slots in the dialogue box, and thus sort on 6 columns!

Hope this helps.

Pete
 
Hi Jackie,
What's more is that you came from the right place as well,
using a newsreader (in your case Forte Agent) instead of one of
various websites that mess up internet searches for everyone,
much appreciated.

Most questions have been asked before and you can
almost always find the answer with a Google search of web sites,
or a Google search of newsgroups (groups search), especially
with a bit of practice.
 

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