Forum Discussion
yennek
Dec 11, 2022Copper Contributor
How to sort the unique() values by their sumifs()
From a large data set, I’m generating a list of unique names with =UNIQUE(...). Next to those unique names there’s a simple =SUMIFS(...) giving the totals. All is good. I can use =Sort(Unique(...)) t...
- Dec 12, 2022
yennek All you can do in a single formula. Try the following formula.
=SORT(HSTACK(UNIQUE(A3:A7),SUMIFS(B3:B7,A3:A7,UNIQUE(A3:A7))),2,-1)
See the attached file.
yennek
Dec 12, 2022Copper Contributor
WONDERFUL THANK YOU! Would never have gotten that on my on.
I actually have more countifs, sumifs, averageifs, going out to the right and will try to incorporate those into the array. But first...
My 365 Subscription (on Mac) does not have the HSTACK function!!! (Infuriating because I just jumped through hoops with Microsoft earlier this week to convert to 365 so I could get the Unique and Filter functions. )
Many Excel functions can be rebuilt through formulas that do what the function does. I wonder if HSTACK... thanks again.
Patrick2788
Dec 12, 2022Silver Contributor
This workaround is good for some basic stacking:
=SORT(IF({1,0},UNIQUE(A3:A7),SUMIFS(B3:B7,A3:A7,UNIQUE(A3:A7))),2,-1)
- yennekDec 13, 2022Copper ContributorThis is helpful thank you.