#1   Report Post  
Freshman
 
Posts: n/a
Default Auto Sorting

Dear all,

I've a table of three columns, namely : Name, Class & Score.

Peter 3A 17
Mary 3B 14
Sam 2A 13

So, in the next session, if Mary's total score is more than Peter's, then
Mary's row of record will jump from row 2 to row 1 and Peter's row will
descend one row down automatically (i.e.without pressing the sort button).
My question is what formula/function should I enter so that the row sequence
can jump in accordance with the total score of each person. Please advise.

Thanks in advance.
  #2   Report Post  
Max
 
Posts: n/a
Default

One non-array formulas play which will deliver what you want ..

Assume the table below is in Sheet1,
cols A to C, data from row2 down

Name Class Score
Peter 3A 17
Mary 3B 14
Sam 2A 13
etc

Use an empty col, say col E

Put in E2: =IF(C2="","",C2-ROW()/10^10)
Copy E2 down to say, E100, to cover the max expected data
(Leave E1 empty)

In Sheet2
----------
With the same headers in A1:C1, viz.: Name Class Score

Put in A2:

=IF(ISERROR(LARGE(Sheet1!$E:$E,ROWS($A$1:A1))),"", INDEX(Sheet1!A:A,MATCH(LAR
GE(Sheet1!$E:$E,ROWS($A$1:A1)),Sheet1!$E:$E,0)))

Copy A2 across to C2, fill down to C100
(cover the same range size as was done in col E in Sheet1)

Sheet2 will return the desired auto-sort results (descending scores)
from the table in Sheet1

In the event of any tied scores, the data lines will appear in the same
relative order that they are in Sheet1

Adapt to suit ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Freshman" wrote in message
...
Dear all,

I've a table of three columns, namely : Name, Class & Score.

Peter 3A 17
Mary 3B 14
Sam 2A 13

So, in the next session, if Mary's total score is more than Peter's, then
Mary's row of record will jump from row 2 to row 1 and Peter's row will
descend one row down automatically (i.e.without pressing the sort button).
My question is what formula/function should I enter so that the row

sequence
can jump in accordance with the total score of each person. Please advise.

Thanks in advance.



  #3   Report Post  
Freshman
 
Posts: n/a
Default

Hi Max,

Sorry to bother you again. For the question below, if two students have the
same score, I want to differentiate the ranking by adding one more column,
say "Daily Performance Score". Then what would the worksheet function be if I
want to sort the rows by "Score" first, then if tie, sort further by "Daily
Performance Score". Please kindly advise.

Many thanks.

"Max" wrote:

One non-array formulas play which will deliver what you want ..

Assume the table below is in Sheet1,
cols A to C, data from row2 down

Name Class Score
Peter 3A 17
Mary 3B 14
Sam 2A 13
etc

Use an empty col, say col E

Put in E2: =IF(C2="","",C2-ROW()/10^10)
Copy E2 down to say, E100, to cover the max expected data
(Leave E1 empty)

In Sheet2
----------
With the same headers in A1:C1, viz.: Name Class Score

Put in A2:

=IF(ISERROR(LARGE(Sheet1!$E:$E,ROWS($A$1:A1))),"", INDEX(Sheet1!A:A,MATCH(LAR
GE(Sheet1!$E:$E,ROWS($A$1:A1)),Sheet1!$E:$E,0)))

Copy A2 across to C2, fill down to C100
(cover the same range size as was done in col E in Sheet1)

Sheet2 will return the desired auto-sort results (descending scores)
from the table in Sheet1

In the event of any tied scores, the data lines will appear in the same
relative order that they are in Sheet1

Adapt to suit ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Freshman" wrote in message
...
Dear all,

I've a table of three columns, namely : Name, Class & Score.

Peter 3A 17
Mary 3B 14
Sam 2A 13

So, in the next session, if Mary's total score is more than Peter's, then
Mary's row of record will jump from row 2 to row 1 and Peter's row will
descend one row down automatically (i.e.without pressing the sort button).
My question is what formula/function should I enter so that the row

sequence
can jump in accordance with the total score of each person. Please advise.

Thanks in advance.




  #4   Report Post  
Max
 
Posts: n/a
Default

"Freshman" wrote:
.. if two students have the same score, I want to
differentiate the ranking by adding one more column,
say "Daily Performance Score". Then what would
the worksheet function be if I want to sort the rows
by "Score" first, then if tie, sort further by "Daily
Performance Score".


In Sheet1
---------
Suppose the "Daily Performance Score"
is added in col D, in D2 down

Think we could try revising the criteria formula in col E to include a
weighted score which covers both the original "Score" and the new "Daily
Performance Score". Let's set the weightage at say: 95% for "Score", and 5%
for "Daily Performance Score".

Then we could put instead in E2:
=IF(OR(C2="",D2=""),"",(C2*95%+D2*5%)-ROW()/10^10)
and copy E2 down as before

(No change to the formulas in Sheet2)

In principle, the weighted score would serve as a "1st layer" tie-breaker,
but we'd still need the arbitrary tie-breaker in the formula: " -ROW()/10^10
" as a final fall-back in case there are still ties in the weighted scores.
But the chances of this occuring should be more remote now.

You could adjust and use your own percentage weights (instead of 95% - 5%,
but the weights should be heavier on the primary col, i.e. the original
"Scores" to be reflective.

Try the above and see whether it works for the actual case.
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #5   Report Post  
Freshman
 
Posts: n/a
Default

Dear Max,

Thank you for your valuable instruction to me and I've completely solve my
problems. Cheers.

Freshman.

"Max" wrote:

"Freshman" wrote:
.. if two students have the same score, I want to
differentiate the ranking by adding one more column,
say "Daily Performance Score". Then what would
the worksheet function be if I want to sort the rows
by "Score" first, then if tie, sort further by "Daily
Performance Score".


In Sheet1
---------
Suppose the "Daily Performance Score"
is added in col D, in D2 down

Think we could try revising the criteria formula in col E to include a
weighted score which covers both the original "Score" and the new "Daily
Performance Score". Let's set the weightage at say: 95% for "Score", and 5%
for "Daily Performance Score".

Then we could put instead in E2:
=IF(OR(C2="",D2=""),"",(C2*95%+D2*5%)-ROW()/10^10)
and copy E2 down as before

(No change to the formulas in Sheet2)

In principle, the weighted score would serve as a "1st layer" tie-breaker,
but we'd still need the arbitrary tie-breaker in the formula: " -ROW()/10^10
" as a final fall-back in case there are still ties in the weighted scores.
But the chances of this occuring should be more remote now.

You could adjust and use your own percentage weights (instead of 95% - 5%,
but the weights should be heavier on the primary col, i.e. the original
"Scores" to be reflective.

Try the above and see whether it works for the actual case.
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--





  #6   Report Post  
Max
 
Posts: n/a
Default

Great to hear that !
Thanks for the feedback ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Freshman" wrote in message
...
Dear Max,

Thank you for your valuable instruction to me and I've completely solve my
problems. Cheers.

Freshman



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
Averaging Values in Auto Filter Mr. Jan Park Excel Worksheet Functions 1 August 3rd 05 03:51 PM
SORTING question Rebecca New Users to Excel 3 February 24th 05 05:35 PM
Adding a KeyID column for sorting Rebecca New Users to Excel 3 February 20th 05 07:09 PM
excel links update not working in auto, calculations in auto Mikey Boy Excel Worksheet Functions 0 December 7th 04 11:53 PM
Why can't my macro use Auto Filter when I told the Sheet Protecti. KC Rippstein Excel Worksheet Functions 1 October 28th 04 06:13 PM


All times are GMT +1. The time now is 10:17 PM.

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

About Us

"It's about Microsoft Excel"