Forum Discussion

caltana's avatar
caltana
Copper Contributor
Feb 20, 2026

Excel array question - spill VOWD based on forecast month

Hi,

Can I have your help on a spilled question?

I have the following table with information.


Fore MonthJan-26Feb-26Mar-26Apr-26May-26Jun-26Jul-26Aug-26Sep-26Oct-26Nov-26Dec-26VOWD
2---3,98315,20311,7792,083-1,742,1621,696,156116,2671,162,366-
2--100,000200,000--500,000650,000300,000-466,000--
3---3,98315,20311,7792,08310,0001,742,1621,696,156116,2671,152,366-
3--100,000200,000-250,000250,000650,000-400,000450,000-100,000
4---2,00015,20311,7792,08310,0001,742,1621,696,156116,267152,3662,000
4--100,000200,000-250,000250,000650,000-400,000350,000-300,000


I would like to have a spilled array formula in VOWD column and the expected result is right there now. The logic is to grab the first 2 columns and sum up the amounts for the first two rows of data, and grab first three columns and sum up for the third and forth rows of data and etc.

Thanks,

Anna

4 Replies

  • Olufemi7's avatar
    Olufemi7
    Iron Contributor

    Hello caltana​,
    Use this dynamic spill formula for VOWD: =MAP(A2:A7, B2:M7, LAMBDA(fm, row, SUM(IFERROR(--TAKE(row, fm), 0)))) – MAP processes each row, fm is the Fore Month, row is the monthly data, TAKE(row, fm) picks the first fm months, IFERROR(--…,0) converts any "-" to 0, and SUM adds them. It spills automatically, sums the first N months per Fore Month, and needs no helper columns.

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    My approach is to use a mesh grid of column coordinates and pick out what you need. MGridλ is a generalized function that returns row or column numbers. Here it's returning column numbers.

    =LET(
        j, MGridλ(MonthlyData, 1),
        mdata, IF(j <= ForeMonth, MonthlyData, 0),
        totals, BYROW(mdata, SUM),
        totals
    )

     This is what it looks like step-by-step:

     

  • NikolinoDE's avatar
    NikolinoDE
    Platinum Contributor

    =MAKEARRAY(ROWS(A2:A7), 1, LAMBDA(r,c,

    LET(

    fore_month, INDEX(A2:A7, r),

    SUMPRODUCT(N(COLUMN(B1:M1)<=COLUMN(B1)+fore_month-1), INDEX(B2:M7, r, 0)))))

     

    Based on your description, the logic is to sum the values from the first N months (where N equals the "Fore Month" value) for each pair of rows.