Contributor

# Creating subtotals within an array formula

I need to create subtotals of data spawned by the =SORT and =FILTER functions. I can do it the old fashioned, hard, way by comparing the value in the current row against the most previous value and if different create my total but...

So far I've not found a way to create the subtotal within the array formula.

The formula is below. All cells referenced are on another sheet and are dynamic and liable to change at any time.

Formula is:

=SORT((FILTER(CHOOSE({1,2,3,4,5,6,7},Transactions!Account,Transactions!Due_Date,Transactions!Provider,Transactions!Expense_Center, Transactions!Expense_Sub_Center,Transactions!Notes,Transactions!Budgeted_Amount),(Transactions!Provider<>"")*(Transactions!Expense_Center<>"")*(Transactions!Category="Expense")*(Transactions!Budgeted_Amount<>""),"")),{1,2,3,4,5})

I sort on the first five cells of the array BUT only want to break and create a subtotal when Transactions!Account changes.

A suggestion here would be greatly appreciated.

Thanks,

TheOldPuterMan AKA John

# Re: Creating subtotals within an array formula

I don't have the Sort/Filter functions, so I can't re-create your scenario or test a solution.

But, if it helps, this formula will create an array of subtotals. Perhaps you can incorporate it or see if it gives you any ideas.