Forum Discussion
TerryBennett
Nov 08, 2025Copper Contributor
Nesting SortBy and Filter functions
Can someone suggest where I've gone wrong with this syntax please: =SORTBY(FILTER(Worklist,List!I2:I500=0),List!A2:A500,1,List!G2:G500,1,List!E2:E500,1) Currently returning the #VALUE! error....
- Nov 10, 2025
=FILTER(SORTBY(Worklist,List!A2:A500,1,List!G2:G500,1,List!E2:E500,1),List!I2:I500=0)Does this return the intended result in your sheet as well?
Currently i can't attach a sample file that's why i've added a screenshot that shows the output if the data is in the same sheet. The shared formula works across sheets in my sample file.
PeterBartholomew1
Nov 10, 2025Silver Contributor
You can filter first but then the sort must reference columns of the filtered array, not the original.
= SORT(FILTER(worklistTbl, worklistTbl[Column4]=0), {1,3,2})With LET the formula might read
= LET(
filteredTable, FILTER(worklistTbl,worklistTbl[Column4]=0),
SORT(filteredTable, {1,3,2})
)
- TerryBennettNov 11, 2025Copper Contributor
Thanks Peter