Forum Discussion
Boulakgnobot
Oct 14, 2023Brass Contributor
HELP with my FILTER + SORTBY FUNCTIONS
Hello Everyone ! Here I have a LIST which I want to FILTER and SORTBY last name then first name. Ci-joint: https://www.cjoint.com/doc/23_10/MJorHJzrNNa_HELP-FILTER-SORTBY.xlsx Thanks !
PeterBartholomew1
Oct 14, 2023Silver Contributor
I think I have two distinct exercises muddled in together but, for what it's worth, my approach is to develop a solution step by step, aiming for a readable syntax.
= LET(
Joinλ, LAMBDA(s, TEXTJOIN(" ",,s)),
females, FILTER(names, gender="F"),
sorted, SORT(females, {2,1}),
fullNms, BYROW(sorted, Joinλ),
WRAPROWS(fullNms, 6, "")
)1. Define a Lambda function for use later
2. Filter the array to return females only
3. Sort the names by surname first, then first name
4. Combine each name to a single string
5. Reshape list, filling with blanks if required
- BoulakgnobotOct 14, 2023Brass Contributor
Thanks you for your answer and help !
Unfortunately this is too complicated for me to understand !