Accounts and Subaccounts with History - Reverse Sorting

Hello,

We have a formula, ACCOUNTSANDSUBACCOUNTSWITHHISTORY, the order of data is always “take a GL account, then find all Subaccounts for that GL account that has activity. When done, move to the next GL account”. I would like to suggest the reverse sorting (“Take a Subaccount, find all affected GL accounts and list them in accending order, then, when done, move to the next Subaccount”)

Hope it makes sense.

Kirill,

This can be achieved by using the =SORT() function, and optionally the CHOOSECOLS function if you want to have the subaccount code displayed first:

=CHOOSECOLS(SORT(ACCOUNTSANDSUBACCOUNTSWITHHISTORY(“Demo”, “ACTUAL”,“01-2019”, “12-2019”), {2,1}),2,1)

Attached is a screenshot showing the result.