How to Use SortBy function?

BrettOlbrys1

Board Regular
Joined
May 1, 2018
Messages
139
Office Version
  1. 365
Platform
  1. Windows
I have the following formula:

=INDEX(SORT(FILTER('Activations Table'!$BH$3:$BJ$5000,('Activations Table'!$BH$3:$BH$5000<>"")*('Activations Table'!$BJ$3:$BJ$5000<>0)),3,-1),SEQUENCE('Activations Table'!$BH$1),{1})

The formula is looking at a table of 3 columns of data:

Column BH - name 1
Column BI - name 2
Column BJ - qty

The formula arranges the names in column BH based on the quantities in column BJ (from greatest to least), and the formula works as expected. But I also want to use the data in column BI as a sorting point (not just column BJ) so that the results will be like this:

Sort first by column BI (alphabetically ascending), but within that sort I want each of the same names in column BI to be sorted by the quantities in column BJ from greatest to least.

How do I modify the above formula to make this work?

Thanks

Brett
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Try:

Excel Formula:
=INDEX(SORT(FILTER('Activations Table'!$BH$3:$BJ$5000,('Activations Table'!$BH$3:$BH$5000<>"")*('Activations Table'!$BJ$3:$BJ$5000<>0)),{2,3},{1,-1}),SEQUENCE('Activations Table'!$BH$1),{1})
 
Upvote 0
Solution
How about
Excel Formula:
=TAKE(SORT(FILTER('Activations Table'!$BH$3:$BJ$5000,('Activations Table'!$BH$3:$BH$5000<>"")*('Activations Table'!$BJ$3:$BJ$5000<>0)),{2,3},{1,-1}),'Activations Table'!$BH$1,1)
 
Upvote 0
Try:

Excel Formula:
=INDEX(SORT(FILTER('Activations Table'!$BH$3:$BJ$5000,('Activations Table'!$BH$3:$BH$5000<>"")*('Activations Table'!$BJ$3:$BJ$5000<>0)),{2,3},{1,-1}),SEQUENCE('Activations Table'!$BH$1),{1})
PERFECT! Thank you.
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,011
Members
452,374
Latest member
keccles

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