Efficient use of dynamic array formulas for report
I've got a table of employee data which contains both their unique identifier (Data column E), role (data column AE), location (data column A) and FTE (data column AB). In this data, employees may appear multiple times as they have contracts which may span location and / or role types.
On my intended report I have roles listed in column A (A16 to A36), location in row B (B3 to Y3) and in each location I have row C titled "headcount" or "FTE" alternating. Each location therefore has two columns to report against (I'll call these HC column and FTE column)
In HC column I have this formula:-
=IFERROR (ROWS (UNIQUE (FILTER(Data!$E:$E,(Data!$A:$A=B$3)*(Data!$AE:$AE=$A6)))),0) In FTE column I have this formula:-
=SUMIFS(Data!$AB:$AB,Data!$AE:$AE,$A6,Data!$A:$A,B$3) All of which work fine. However, because the dynamic array formula for HC Column is computing the Unique(filter()) formula many times on the spreadsheet, it is CPU heavy.
With help from AI, if I had a table just with the HC column data being reported I could use a single spill formula (I had to turn the data in to a table) which appears a lot less CPU intensive. But I lose the two column layout which I'd like to preserve. I could implement a third sheet to pull through from this formula and the sumifs data, but is there a way to combine the two formulae above so that each alternating column returns HC or FTE as appropriate? Each col has HC or FTE as a header.
=LET( uAE, $A6:$A$36, uA, $B$3:$Y$3, makeSum, LAMBDA(ae,a, SUMIFS(TData[COL_E], TData[COL_AE], ae, TData[COL_A], a)), MAKEARRAY(ROWS(uAE), COLUMNS(uA), LAMBDA(r,c, makeSum(INDEX(uAE, r), INDEX(uA, c))) ) ) [link] [comments]
Want to read more?
Check out the full article on the original site