FILTER - SORTBY result of another filter

myall_blues

Well-known Member
Joined
Nov 26, 2015
Messages
679
Office Version
  1. 365
Platform
  1. Windows
Is it possible to SORTBY the result of a FILTER query by the results of another filter query? I've tried a few options but I can't make it work.
In the following simplified example (my real case is more complex with more columns but this is the basic gist of the problem) I have two sets of possibly matching data that I wish to check if they do match.

In columns G and H I have extracted the data from the two different years using FILTER. In column I, I tried to use SORTBY to sort the results of the 2000 data into the same order as the 1995 data but that didn't work. Based on the answer given here I tried using INDEX in column J but also without success.

Any insight appreciated.

Book1
ABCDEFGHIJ
1Data 1Data 2Filter Data 1 (1995)Filter Data 2 (2000)Filter Data 2 (2000) ..SORTBYFilter Data 2 (2000) ..SORTBY with INDEX
22000CBC0061995CBC013CBC001CBC009CBC009CBC009
31995CBC0062000CBC009CBC002CBC001CBC001CBC001
42000CBC0132000CBC001CBC006CBC002CBC002CBC002
51995CBC0012000CBC002CBC009CBC013CBC013CBC013
61995CBC0091995CBC002CBC013CBC006CBC006CBC006
71995CBC0021995CBC001
82000CBC0011995CBC009
92000CBC0022000CBC013
101995CBC0131995CBC006
112000CBC0092000CBC006
Sheet1
Cell Formulas
RangeFormula
G2:G6G2=SORT(FILTER(B2:B11,A2:A11=1995))
H2:H6H2=FILTER(E2:E11,D2:D11=2000)
I2:I6I2=SORTBY(FILTER(E2:E11,D2:D11=2000),G2#)
J2:J6J2=LET(_x,FILTER(E2:E11,D2:D11=2000),_y,SORT(FILTER(B2:B11,A2:A11=1995)),SORTBY(_x,INDEX(_y,0,1)))
Dynamic array formulas.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,225,738
Messages
6,186,725
Members
453,368
Latest member
positivemind

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