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 14, 2022Copper Contributor
Harun24HR Patrick2788 This has been a very, very helpful discussion. Thank you. Microsoft has returned my HSTACK() function. So, I now have a single function, a mile long, decipherable by no one, that creates an array 13 columns wide with many variations of sumifs, countifs, etc, etc. To sort by any of the 13 columns requires entering a 1, -1 above any of the columns and then =sort(hstack(unique(filter(.... figures it out. Somewhat miraculous, but me thinks I should go back and rethink how the whole house is constructed. Thanks again.
Patrick2788
Dec 14, 2022Silver Contributor
You're welcome! Glad the 'horsepower' has been restored to your Excel.