Forum Discussion

cparb's avatar
cparb
Copper Contributor
Apr 11, 2021
Solved

SPILL ERROR with SUMProduct and lookup from other sheet

Device and OS platform, Laptop/Windows 10  Excel product name and version number Office 365 Excel file Attached - specifically looking at cells T5 and T12 I'm attempting to use the same formula t...
  • SergeiBaklan's avatar
    Apr 11, 2021

    cparb 

    These are different formulas, For example, in P7 is

    =SUMPRODUCT(--(MONTH(C16:C4000)=7),
    (($H$16:$H$4000=Sheet1!$A$1)+
    ($H$16:$H$4000=Sheet1!$A$2)+
    ($H$16:$H$4000=Sheet1!$A$3)+
    ($H$16:$H$4000=Sheet1!$A$4)+
    ($H$16:$H$4000=Sheet1!$A$5)+
    ($H$16:$H$4000=Sheet1!$A$6)+
    ($H$16:$H$4000=Sheet1!$A$7)+
    ($H$16:$H$4000=Sheet1!$A$8)+
    ($H$16:$H$4000=Sheet1!$A$9)+
    ($H$16:$H$4000=Sheet1!$A$10)+
    ($H$16:$H$4000=Sheet1!$A$11)+
    ($H$16:$H$4000=Sheet1!$A$12)+
    ($H$16:$H$4000=Sheet1!$A$13)+
    ($H$16:$H$4000=Sheet1!$A$14)+
    ($H$16:$H$4000=Sheet1!$A$15))
    )
    

    which returns number of records with July date and any of titles from Sheet1 in column H.

    In T5 is different formula

    =SUMPRODUCT( --ISNUMBER(C16:C4000),--MONTH(C16:C4000)=1)*
    (($H$16:$H$4000=Sheet1!$A$1)+
     ($H$16:$H$4000=Sheet1!$A$2)+
     ($H$16:$H$4000=Sheet1!$A$3)+
     ($H$16:$H$4000=Sheet1!$A$4)+
     ($H$16:$H$4000=Sheet1!$A$5)+
     ($H$16:$H$4000=Sheet1!$A$6)+
     ($H$16:$H$4000=Sheet1!$A$7)+
     ($H$16:$H$4000=Sheet1!$A$8)+
     ($H$16:$H$4000=Sheet1!$A$9)+
     ($H$16:$H$4000=Sheet1!$A$10)+
     ($H$16:$H$4000=Sheet1!$A$11)+
     ($H$16:$H$4000=Sheet1!$A$12)+
     ($H$16:$H$4000=Sheet1!$A$13)+
     ($H$16:$H$4000=Sheet1!$A$14)+
     ($H$16:$H$4000=Sheet1!$A$15)
    )

    You sum all records with July date and multiple this numbers on array of values which indicates if any from Sheet1 is in column H. Result is array which formulas try to return. But that's not enough space for this array in the sheet, thus #SPILL error.

    I'm not sure what exactly you'd like to calculate, as varioant formula could be

    =SUM( (MONTH($C$16:$C$4000)=MONTH(1&O5))*
           COUNTIF(Sheet1!$A$1:$A$15,$H$16:$H$4000)
    )

Resources