SOLVED

Sortby combined with Filter and Index Functions

Copper Contributor

Hello -

 

Is possible to use the SORTBY function on the Communication Details table to sort by "next communication date" and then "next communication responsible party" (or at a minimum "next communication date")? I am not able to figure this out.

 

Here is the link to the document on Google docs. I believe you will need to download it to access the formulas. 

 

ligg_1_0-1643830074871.png

 

 

Thank you! 

 

3 Replies
best response confirmed by ligg_1 (Copper Contributor)
Solution

Hi @ligg_1 

Much easier with a sample => Thanks. On 'Summary Dashboard' sheet, to sort the array in H9# by column2 (Next Communication Date) then by column4 (Next Communication Responsible Party), formula should be:

=LET(
    arr, FILTER(
            INDEX(StakeholderCommPlan, SEQUENCE(ROWS(StakeholderCommPlan)), MATCH(H8:K8,StakeholderCommPlan[#Headers],0)),
            StakeholderCommPlan[IDN]='Summary Dashboard'!C4,
            "No Upcoming Communication Dates"
    ),
    SORTBY(arr, INDEX(arr,,2),1, INDEX(arr,,4),1)
)

Given you use other dynamic array functions I would suggest you replace MATCH with XMATCH

Thank you very much!
Glad I could help
1 best response

Accepted Solutions
best response confirmed by ligg_1 (Copper Contributor)
Solution

Hi @ligg_1 

Much easier with a sample => Thanks. On 'Summary Dashboard' sheet, to sort the array in H9# by column2 (Next Communication Date) then by column4 (Next Communication Responsible Party), formula should be:

=LET(
    arr, FILTER(
            INDEX(StakeholderCommPlan, SEQUENCE(ROWS(StakeholderCommPlan)), MATCH(H8:K8,StakeholderCommPlan[#Headers],0)),
            StakeholderCommPlan[IDN]='Summary Dashboard'!C4,
            "No Upcoming Communication Dates"
    ),
    SORTBY(arr, INDEX(arr,,2),1, INDEX(arr,,4),1)
)

Given you use other dynamic array functions I would suggest you replace MATCH with XMATCH

View solution in original post