exceldynamic-arraysspill-range

Call spill range within dynamic array formula


I am trying to query a list of sales stored in Excel using a dynamic array formula referencing a spill range and this does not work.

Here is the context:

Here is what I have tried on the report sheet:

Unfortunately, this last formula unfortunately does not work:

The lack of spilling makes me wonder whether the spill range reference within the FILTER function is recognized...

How could I get this formula to work ?

Sales table Non-working formula


Solution

  • Use SUMIFS():

    =SUMIFS(tabSales[Amount],tabSales[Year],D2#,tabSales[Customer],SelCust)
    

    This should return an array properly.

    If one wants to do both columns in one dynamic formula we can use LET and CHOOSE:

    =let(
        slcust,tabSales[Customer],
        amt,tabSales[Amount],
        yr,tabSales[Year],
        unYr,UNIQUE(FILTER(yr,slcust=SelCust)),
        sm,SUMIFS(amt,yr,unyr,slcust,SelCust),
        Choose({1,2},unyr,sm))