filter and sort function (custom sort list order)

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
289
Office Version
  1. 365
Platform
  1. Windows
Gurus,

I was able to use the filter function, but I can't apply the sorting based on my custom sort list order. Please see attached

1659341915431.png


Thank you very much,
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
How about VBA solution with a button, with a click, result will be in other sheet?
If its OK, try to upload mini sheet via XL2BB.
 
Upvote 0
Can you give us the data with XL2BB so we can copy to test with?
 
Upvote 0
Can you give us the data with XL2BB so we can copy to test with?
custom sor list order.xlsx
ABCDEFGHIJKLMN
2NAMEEMPDEPARTMENT07-31-202208-01-202208-02-202208-03-2022
3Tom201cc2121custom sort list order
4Jack202db33bb
5Suzie203aa21bc
6Rajesh204ab4aa
7Kevin205bb2222ab
8Belinda206bc3333cc
9Sally207bcdb
10David208aa12
11Joe209cc721
12Jim210db153
13
14SHOULD BE RESULT
15NAMEEMPDEPARTMENTCriteriaToday (08/1/2022)
16Kevin205bb>1
17Belinda206bcSkip empty cells
18Suzie203aasort by custom list order
19David208aa
20Rajesh204abfilter the name, emp and department which contains values greater than 1 and that matching the current date
21Joe209ccThe result should be sorted based on the custom sort list order
22Jim210db
Sheet1 (2)


Thank you so much
 
Upvote 0
How about VBA solution with a button, with a click, result will be in other sheet?
If its OK, try to upload mini sheet via XL2BB.
thank you for the suggestion.. will try that if there is no way we can do it via excel functions..
 
Upvote 0
How about
Excel Formula:
=LET(a,INDEX(D2:G11,,MATCH(TODAY(),D1:G1,0)),b,FILTER(A2:C11,a>1),SORTBY(b,MATCH(INDEX(b,,3),I3:I8,0)))
 
Upvote 0
Solution
Since 'a' is only used once in subsequent calculations the formula could be shortened/simplified(?) ever-so-slightly by removing it. :)

Excel Formula:
=LET(b,FILTER(A2:C11,INDEX(D2:G11,,MATCH(TODAY(),D1:G1,0))>1),SORTBY(b,MATCH(INDEX(b,,3),I3:I8,0)))
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,895
Messages
6,122,128
Members
449,066
Latest member
Andyg666

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