Dynamically sort list based off associated values with tie-breaker values
up vote
0
down vote
favorite
I'm trying to sort students based off frequency of participation. I have a table that is automatically generated totaling up how often a student has participated in the last few days.
I want it to do 2 things that I can't figure out.
- I want it to ignore students that are at 0 removing them from the resulting rankings.
- The first number is most important but I want it to reference the next value in the result of a tie.
Short example of table:
Andy - 1 1 2 3
Brad - 0 1 2 3
Cade - 1 2 3 4
Dane - 1 1 1 2
Desired result:
Cade - 1
Andy - 1
Dane - 1
The tie-breaker isn't that important and I figure I can have conditional formatting to remove children at 0, but I still can't seem to figure it out.
The closest formulas I have found in my searching are:
=INDEX($A$10:$A$9,MATCH(ROWS($C$1:C1),$C$1:$C$9,0))
This one doesn't work because it returns #N/A for pretty much all students who are tied.
=IFERROR(INDEX($C$1:$C$9,MATCH(SMALL(NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),ROWS($C$1:C1)+SUM(--ISBLANK($C$1:$C$9))),NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),0)),"")
I had this formula that can handle ties but it needs to be OFFSET but I don't know how since it is an array formula. Also, with both these formulas it reverses the ranks with the lowest values at the top. If anyone could assist me I would greatly appreciate it. I'm doing this so that I can give all students a chance to participate equally.
excel excel-formula excel-2016
add a comment |
up vote
0
down vote
favorite
I'm trying to sort students based off frequency of participation. I have a table that is automatically generated totaling up how often a student has participated in the last few days.
I want it to do 2 things that I can't figure out.
- I want it to ignore students that are at 0 removing them from the resulting rankings.
- The first number is most important but I want it to reference the next value in the result of a tie.
Short example of table:
Andy - 1 1 2 3
Brad - 0 1 2 3
Cade - 1 2 3 4
Dane - 1 1 1 2
Desired result:
Cade - 1
Andy - 1
Dane - 1
The tie-breaker isn't that important and I figure I can have conditional formatting to remove children at 0, but I still can't seem to figure it out.
The closest formulas I have found in my searching are:
=INDEX($A$10:$A$9,MATCH(ROWS($C$1:C1),$C$1:$C$9,0))
This one doesn't work because it returns #N/A for pretty much all students who are tied.
=IFERROR(INDEX($C$1:$C$9,MATCH(SMALL(NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),ROWS($C$1:C1)+SUM(--ISBLANK($C$1:$C$9))),NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),0)),"")
I had this formula that can handle ties but it needs to be OFFSET but I don't know how since it is an array formula. Also, with both these formulas it reverses the ranks with the lowest values at the top. If anyone could assist me I would greatly appreciate it. I'm doing this so that I can give all students a chance to participate equally.
excel excel-formula excel-2016
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to sort students based off frequency of participation. I have a table that is automatically generated totaling up how often a student has participated in the last few days.
I want it to do 2 things that I can't figure out.
- I want it to ignore students that are at 0 removing them from the resulting rankings.
- The first number is most important but I want it to reference the next value in the result of a tie.
Short example of table:
Andy - 1 1 2 3
Brad - 0 1 2 3
Cade - 1 2 3 4
Dane - 1 1 1 2
Desired result:
Cade - 1
Andy - 1
Dane - 1
The tie-breaker isn't that important and I figure I can have conditional formatting to remove children at 0, but I still can't seem to figure it out.
The closest formulas I have found in my searching are:
=INDEX($A$10:$A$9,MATCH(ROWS($C$1:C1),$C$1:$C$9,0))
This one doesn't work because it returns #N/A for pretty much all students who are tied.
=IFERROR(INDEX($C$1:$C$9,MATCH(SMALL(NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),ROWS($C$1:C1)+SUM(--ISBLANK($C$1:$C$9))),NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),0)),"")
I had this formula that can handle ties but it needs to be OFFSET but I don't know how since it is an array formula. Also, with both these formulas it reverses the ranks with the lowest values at the top. If anyone could assist me I would greatly appreciate it. I'm doing this so that I can give all students a chance to participate equally.
excel excel-formula excel-2016
I'm trying to sort students based off frequency of participation. I have a table that is automatically generated totaling up how often a student has participated in the last few days.
I want it to do 2 things that I can't figure out.
- I want it to ignore students that are at 0 removing them from the resulting rankings.
- The first number is most important but I want it to reference the next value in the result of a tie.
Short example of table:
Andy - 1 1 2 3
Brad - 0 1 2 3
Cade - 1 2 3 4
Dane - 1 1 1 2
Desired result:
Cade - 1
Andy - 1
Dane - 1
The tie-breaker isn't that important and I figure I can have conditional formatting to remove children at 0, but I still can't seem to figure it out.
The closest formulas I have found in my searching are:
=INDEX($A$10:$A$9,MATCH(ROWS($C$1:C1),$C$1:$C$9,0))
This one doesn't work because it returns #N/A for pretty much all students who are tied.
=IFERROR(INDEX($C$1:$C$9,MATCH(SMALL(NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),ROWS($C$1:C1)+SUM(--ISBLANK($C$1:$C$9))),NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),0)),"")
I had this formula that can handle ties but it needs to be OFFSET but I don't know how since it is an array formula. Also, with both these formulas it reverses the ranks with the lowest values at the top. If anyone could assist me I would greatly appreciate it. I'm doing this so that I can give all students a chance to participate equally.
excel excel-formula excel-2016
excel excel-formula excel-2016
asked Nov 9 at 16:33
Daniel Sachs
74
74
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Use a helper column. In that column put the following formula:
=IF(B1=0,"n/a",SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1)))))
This will return a single number based on the rankings.
Then in your output column use:
=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")
Then a simple VLOOKUP to return the first number:
=IF(I1<>"",VLOOKUP(I1,A:B,2,FALSE),"")
I figured I would need a helper column but couldn't think of what it would be. Turning the values into a decimal is such a clever and simple solution. This is great, however I am still having 1 problem with this part. '=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")' If the results are a tie to the very end it will return the same name multiple times. When changing the values so that Andy and Dane both have 1.123, it will rank Andy twice. link
– Daniel Sachs
Nov 10 at 2:13
I have found a solution to the problem where I was returning the same name multiple times in case of a tie. I thought I would share it in case someone could use it in the future. I changed the first formula to=IF(B1=0,"n/a",SUM(-.0000000001*ROW(),SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1))))))
This way it adds a small value to the results but not enough to change the rankings. Probably not the most elegant solution but it seems to work. Thank you Scott Craner for getting me this far
– Daniel Sachs
Nov 10 at 11:46
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Use a helper column. In that column put the following formula:
=IF(B1=0,"n/a",SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1)))))
This will return a single number based on the rankings.
Then in your output column use:
=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")
Then a simple VLOOKUP to return the first number:
=IF(I1<>"",VLOOKUP(I1,A:B,2,FALSE),"")
I figured I would need a helper column but couldn't think of what it would be. Turning the values into a decimal is such a clever and simple solution. This is great, however I am still having 1 problem with this part. '=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")' If the results are a tie to the very end it will return the same name multiple times. When changing the values so that Andy and Dane both have 1.123, it will rank Andy twice. link
– Daniel Sachs
Nov 10 at 2:13
I have found a solution to the problem where I was returning the same name multiple times in case of a tie. I thought I would share it in case someone could use it in the future. I changed the first formula to=IF(B1=0,"n/a",SUM(-.0000000001*ROW(),SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1))))))
This way it adds a small value to the results but not enough to change the rankings. Probably not the most elegant solution but it seems to work. Thank you Scott Craner for getting me this far
– Daniel Sachs
Nov 10 at 11:46
add a comment |
up vote
1
down vote
accepted
Use a helper column. In that column put the following formula:
=IF(B1=0,"n/a",SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1)))))
This will return a single number based on the rankings.
Then in your output column use:
=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")
Then a simple VLOOKUP to return the first number:
=IF(I1<>"",VLOOKUP(I1,A:B,2,FALSE),"")
I figured I would need a helper column but couldn't think of what it would be. Turning the values into a decimal is such a clever and simple solution. This is great, however I am still having 1 problem with this part. '=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")' If the results are a tie to the very end it will return the same name multiple times. When changing the values so that Andy and Dane both have 1.123, it will rank Andy twice. link
– Daniel Sachs
Nov 10 at 2:13
I have found a solution to the problem where I was returning the same name multiple times in case of a tie. I thought I would share it in case someone could use it in the future. I changed the first formula to=IF(B1=0,"n/a",SUM(-.0000000001*ROW(),SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1))))))
This way it adds a small value to the results but not enough to change the rankings. Probably not the most elegant solution but it seems to work. Thank you Scott Craner for getting me this far
– Daniel Sachs
Nov 10 at 11:46
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Use a helper column. In that column put the following formula:
=IF(B1=0,"n/a",SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1)))))
This will return a single number based on the rankings.
Then in your output column use:
=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")
Then a simple VLOOKUP to return the first number:
=IF(I1<>"",VLOOKUP(I1,A:B,2,FALSE),"")
Use a helper column. In that column put the following formula:
=IF(B1=0,"n/a",SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1)))))
This will return a single number based on the rankings.
Then in your output column use:
=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")
Then a simple VLOOKUP to return the first number:
=IF(I1<>"",VLOOKUP(I1,A:B,2,FALSE),"")
edited Nov 9 at 17:24
answered Nov 9 at 16:53
Scott Craner
87k82449
87k82449
I figured I would need a helper column but couldn't think of what it would be. Turning the values into a decimal is such a clever and simple solution. This is great, however I am still having 1 problem with this part. '=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")' If the results are a tie to the very end it will return the same name multiple times. When changing the values so that Andy and Dane both have 1.123, it will rank Andy twice. link
– Daniel Sachs
Nov 10 at 2:13
I have found a solution to the problem where I was returning the same name multiple times in case of a tie. I thought I would share it in case someone could use it in the future. I changed the first formula to=IF(B1=0,"n/a",SUM(-.0000000001*ROW(),SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1))))))
This way it adds a small value to the results but not enough to change the rankings. Probably not the most elegant solution but it seems to work. Thank you Scott Craner for getting me this far
– Daniel Sachs
Nov 10 at 11:46
add a comment |
I figured I would need a helper column but couldn't think of what it would be. Turning the values into a decimal is such a clever and simple solution. This is great, however I am still having 1 problem with this part. '=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")' If the results are a tie to the very end it will return the same name multiple times. When changing the values so that Andy and Dane both have 1.123, it will rank Andy twice. link
– Daniel Sachs
Nov 10 at 2:13
I have found a solution to the problem where I was returning the same name multiple times in case of a tie. I thought I would share it in case someone could use it in the future. I changed the first formula to=IF(B1=0,"n/a",SUM(-.0000000001*ROW(),SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1))))))
This way it adds a small value to the results but not enough to change the rankings. Probably not the most elegant solution but it seems to work. Thank you Scott Craner for getting me this far
– Daniel Sachs
Nov 10 at 11:46
I figured I would need a helper column but couldn't think of what it would be. Turning the values into a decimal is such a clever and simple solution. This is great, however I am still having 1 problem with this part. '=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")' If the results are a tie to the very end it will return the same name multiple times. When changing the values so that Andy and Dane both have 1.123, it will rank Andy twice. link
– Daniel Sachs
Nov 10 at 2:13
I figured I would need a helper column but couldn't think of what it would be. Turning the values into a decimal is such a clever and simple solution. This is great, however I am still having 1 problem with this part. '=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")' If the results are a tie to the very end it will return the same name multiple times. When changing the values so that Andy and Dane both have 1.123, it will rank Andy twice. link
– Daniel Sachs
Nov 10 at 2:13
I have found a solution to the problem where I was returning the same name multiple times in case of a tie. I thought I would share it in case someone could use it in the future. I changed the first formula to
=IF(B1=0,"n/a",SUM(-.0000000001*ROW(),SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1))))))
This way it adds a small value to the results but not enough to change the rankings. Probably not the most elegant solution but it seems to work. Thank you Scott Craner for getting me this far– Daniel Sachs
Nov 10 at 11:46
I have found a solution to the problem where I was returning the same name multiple times in case of a tie. I thought I would share it in case someone could use it in the future. I changed the first formula to
=IF(B1=0,"n/a",SUM(-.0000000001*ROW(),SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1))))))
This way it adds a small value to the results but not enough to change the rankings. Probably not the most elegant solution but it seems to work. Thank you Scott Craner for getting me this far– Daniel Sachs
Nov 10 at 11:46
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53229737%2fdynamically-sort-list-based-off-associated-values-with-tie-breaker-values%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown