Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sorting on more then 3 columns


I have a large number of sets of data (500000) consisting of 9 column
of values each. I want to sort on ALL columns .
Using the Range.Sort method I can only specify 3 columns to sort on.
How can I sort on all columns

--
JackRn
-----------------------------------------------------------------------
JackRnl's Profile: http://www.excelforum.com/member.php...fo&userid=3717
View this thread: http://www.excelforum.com/showthread.php?threadid=56980

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Sorting on more then 3 columns

first sort on the columns of least importance, then sort again on the other columns

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"JackRnl" wrote in message
...
|
| I have a large number of sets of data (500000) consisting of 9 columns
| of values each. I want to sort on ALL columns .
| Using the Range.Sort method I can only specify 3 columns to sort on.
| How can I sort on all columns?
|
|
| --
| JackRnl
| ------------------------------------------------------------------------
| JackRnl's Profile: http://www.excelforum.com/member.php...o&userid=37172
| View this thread: http://www.excelforum.com/showthread...hreadid=569801
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sorting on more then 3 columns


Thanks for the reply,

Indeed a possibility and I did that already, but the disadvantage i
that it takes MUCH more time.
In my app the calculations take 17 seconds and sorting takes 4 second
for each sort. I actually timed and results are
0 sorts 17 seconds
1 sort 21 seconds (columns 1-2-3)
2 sorts 25 seconds (columns 4-5-6 followed by 1-2-3)
3 sorts 29 seconds (column 7 followed by 4-5-6 and 1-2-3)
and I might have more columns in the future, so you understand I woul
like to avoid sorting several times and would be pleased with a faste
solutio

--
JackRn
-----------------------------------------------------------------------
JackRnl's Profile: http://www.excelforum.com/member.php...fo&userid=3717
View this thread: http://www.excelforum.com/showthread.php?threadid=56980

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Sorting on more then 3 columns

This is the official Microsoft recommendation. I don't think there is anything you can do that makes it faster, certainly not try
own VBA macros.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"JackRnl" wrote in message
...
|
| Thanks for the reply,
|
| Indeed a possibility and I did that already, but the disadvantage is
| that it takes MUCH more time.
| In my app the calculations take 17 seconds and sorting takes 4 seconds
| for each sort. I actually timed and results are
| 0 sorts 17 seconds
| 1 sort 21 seconds (columns 1-2-3)
| 2 sorts 25 seconds (columns 4-5-6 followed by 1-2-3)
| 3 sorts 29 seconds (column 7 followed by 4-5-6 and 1-2-3)
| and I might have more columns in the future, so you understand I would
| like to avoid sorting several times and would be pleased with a faster
| solution
|
|
| --
| JackRnl
| ------------------------------------------------------------------------
| JackRnl's Profile: http://www.excelforum.com/member.php...o&userid=37172
| View this thread: http://www.excelforum.com/showthread...hreadid=569801
|


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Sorting on more then 3 columns

Sometimes I concatenate several values into one column to accomplish
this.

That is, in your 10th column enter the fomula A1&B1&C1&.... then sort
by that column.

You may have to convert the values to text if they are of varying
lengths.

That is text(A1,"#####")& ...

Best Regards

Jim Palmer


Niek Otten wrote:
This is the official Microsoft recommendation. I don't think there is anything you can do that makes it faster, certainly not try
own VBA macros.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"JackRnl" wrote in message
...
|
| Thanks for the reply,
|
| Indeed a possibility and I did that already, but the disadvantage is
| that it takes MUCH more time.
| In my app the calculations take 17 seconds and sorting takes 4 seconds
| for each sort. I actually timed and results are
| 0 sorts 17 seconds
| 1 sort 21 seconds (columns 1-2-3)
| 2 sorts 25 seconds (columns 4-5-6 followed by 1-2-3)
| 3 sorts 29 seconds (column 7 followed by 4-5-6 and 1-2-3)
| and I might have more columns in the future, so you understand I would
| like to avoid sorting several times and would be pleased with a faster
| solution
|
|
| --
| JackRnl
| ------------------------------------------------------------------------
| JackRnl's Profile: http://www.excelforum.com/member.php...o&userid=37172
| View this thread: http://www.excelforum.com/showthread...hreadid=569801
|




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Sorting on more then 3 columns

<certainly not try own VBA macros.
I meant writing your own sort mechanism.
However, you could record a macro which does the subsequent sorts automatically.
You'll gain the time needed to select menus etc, which will probably more than regain the sort time.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Niek Otten" wrote in message ...
| This is the official Microsoft recommendation. I don't think there is anything you can do that makes it faster, certainly not
try
| own VBA macros.
|
| --
| Kind regards,
|
| Niek Otten
| Microsoft MVP - Excel
|
| "JackRnl" wrote in message
| ...
||
|| Thanks for the reply,
||
|| Indeed a possibility and I did that already, but the disadvantage is
|| that it takes MUCH more time.
|| In my app the calculations take 17 seconds and sorting takes 4 seconds
|| for each sort. I actually timed and results are
|| 0 sorts 17 seconds
|| 1 sort 21 seconds (columns 1-2-3)
|| 2 sorts 25 seconds (columns 4-5-6 followed by 1-2-3)
|| 3 sorts 29 seconds (column 7 followed by 4-5-6 and 1-2-3)
|| and I might have more columns in the future, so you understand I would
|| like to avoid sorting several times and would be pleased with a faster
|| solution
||
||
|| --
|| JackRnl
|| ------------------------------------------------------------------------
|| JackRnl's Profile: http://www.excelforum.com/member.php...o&userid=37172
|| View this thread: http://www.excelforum.com/showthread...hreadid=569801
||
|
|


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sorting on more then 3 columns


Thanks for the rapid replies (again),

Certainly I will not write my own macros for that, I know you can't win
compared to the build in code using an interpreter like VBA.
It is a pitty Array.Sort has not been implemented , would help a LOT of
people I think.
For identifying if a set is unique while filling the sets I already
created a key consisting of a "concatanated" string (actually summing
the values of the columns each multiplicated by a constant specific for
that column) and considered sorting on them. I guess I will need to do
that as I found nothing else.

Thanks for the help


--
JackRnl
------------------------------------------------------------------------
JackRnl's Profile: http://www.excelforum.com/member.php...o&userid=37172
View this thread: http://www.excelforum.com/showthread...hreadid=569801

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting several columns LTJ Excel Discussion (Misc queries) 1 April 20th 10 03:05 PM
freezing columns labels while sorting columns Stan New Users to Excel 1 December 3rd 09 11:30 AM
help with sorting text in columns to match other columns rkat Excel Discussion (Misc queries) 1 August 11th 06 03:42 AM
sorting more than 3 columns saybut Excel Discussion (Misc queries) 4 February 20th 06 12:03 PM
Sorting Columns JohnT Excel Worksheet Functions 3 March 5th 05 10:15 PM


All times are GMT +1. The time now is 04:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"