unique with sort

orsm6

Well-known Member
Joined
Oct 3, 2012
Messages
515
Office Version
  1. 365
Platform
  1. Windows
Hi all - trying to return a unique list that is sorted high to low, but struggling.

using this formula: =SORT(UNIQUE(FILTER(Table134[score],(Table134[DIV]=2)*(Table134[WEEK]='WEEKLY SUMMARY'!X3))),,1)
or =SORT(UNIQUE(FILTER(Table134[score],(Table134[DIV]=2)*(Table134[WEEK]='WEEKLY SUMMARY'!X3))),,-1)

isn't working.....

it will result in as example:
10-5
13-2
9-6

where as i need to show
13-2
10-5
9-6

what am i doing wrong?
also to be noted is that the number list that the formula points at is a concatenated list.

TIA
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try it as below:
=let(u,UNIQUE(FILTER(Table134[score],(Table134[DIV]=2)*(Table134[WEEK]='WEEKLY SUMMARY'!X3))),sortby(u,--TEXTBEFORE(u,"-"),-1))

Book1
AB
210-513-2
313-210-5
49-69-6
Sheet2
Cell Formulas
RangeFormula
B2:B4B2=SORTBY(A2:A4,--TEXTBEFORE(A2:A4,"-"),-1)
Dynamic array formulas.
 
Upvote 0
Try it as below:
=let(u,UNIQUE(FILTER(Table134[score],(Table134[DIV]=2)*(Table134[WEEK]='WEEKLY SUMMARY'!X3))),sortby(u,--TEXTBEFORE(u,"-"),-1))

Book1
AB
210-513-2
313-210-5
49-69-6
Sheet2
Cell Formulas
RangeFormula
B2:B4B2=SORTBY(A2:A4,--TEXTBEFORE(A2:A4,"-"),-1)
Dynamic array formulas.
thank you for your help, this works great for having the numbers sorted in the right order, but I didn't account for the word "bye" which is now at the top of the list.... but that's ok, i might be able to do something :)
 
Upvote 0
To handle text you could use
Fluff.xlsm
AB
1
210-513-2
313-210-5
49-69-6
5byebye
Master
Cell Formulas
RangeFormula
B2:B5B2=SORTBY(A2:A5,IFERROR(--TEXTBEFORE(A2:A5,"-"),0),-1)
Dynamic array formulas.
 
Upvote 0
Could also use TEXTBEFORE's final optional argument.

23 07 18.xlsm
AB
1
210-513-2
313-210-5
4bye9-6
59-6bye
Sortby
Cell Formulas
RangeFormula
B2:B5B2=SORTBY(A2:A5,--TEXTBEFORE(A2:A5,"-",,,,0),-1)
Dynamic array formulas.
 
Upvote 0
Solution
To handle text you could use
Fluff.xlsm
AB
1
210-513-2
313-210-5
49-69-6
5byebye
Master
Cell Formulas
RangeFormula
B2:B5B2=SORTBY(A2:A5,IFERROR(--TEXTBEFORE(A2:A5,"-"),0),-1)
Dynamic array formulas.
appreciate your help, thank you i like solutions :)
 
Upvote 0
Could also use TEXTBEFORE's final optional argument.

23 07 18.xlsm
AB
1
210-513-2
313-210-5
4bye9-6
59-6bye
Sortby
Cell Formulas
RangeFormula
B2:B5B2=SORTBY(A2:A5,--TEXTBEFORE(A2:A5,"-",,,,0),-1)
Dynamic array formulas.
appreciate your help, thank you i like solutions :)
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top