Forum Discussion
Mr_FunGuy
Jul 19, 2022Copper Contributor
Trying to use "If" array to pull data in order from highest stat to lowest
My starting formula for Q2 is: =if (K2=$B2,$B$1,(if(K2=$C2, $C$1,(if(K2=$D2,$D$1,(if(K2=$E2,$E$1,(if(K2=$F2,$F$1,(if(K2=$G2,$G$1,"false")))))))))) This gives me the first value associated with ...
- Jul 19, 2022
In Google Sheets I was able to reproduce it with this formula:
=TRANSPOSE(INDEX(SORT(TRANSPOSE(A1:F2),2,0),,1))
Rsartori76
Jul 19, 2022Brass Contributor
What version of Excel are you using? If you're using Excel 365 you can use this formula in cell Q2.
| =SORTBY(A1:F1,A2:F2,-1) |
- Mr_FunGuyJul 19, 2022Copper ContributorUsing Google sheets... How about a SortN function??
- Rsartori76Jul 19, 2022Brass Contributor
In Google Sheets I was able to reproduce it with this formula:
=TRANSPOSE(INDEX(SORT(TRANSPOSE(A1:F2),2,0),,1))
- Mr_FunGuyJul 20, 2022Copper ContributorThanks! I ended up using the following:
=TRANSPOSE(INDEX(SORT(TRANSPOSE({$B$1:$G$1;B2:G2}),2,0),,1))
Thanks a ton!
- Patrick2788Jul 19, 2022Silver ContributorI did not realize you were using Google Sheets.