google-sheetsgoogle-sheets-formulaarray-formulas

Arrayformula with Query in Google Sheets


I tried to get ARRAYFORMULA in Google Sheets to automatically fill the cells below with the formula. The following code only works for the first row. Can I ask for help?

=ArrayFormula( Query(DatenTime!$A$2:$O; "Select sum(L) WHERE O ="&O10&" AND N ="&N10&" label sum(L) ''") )


Solution

  • QUERY is not the right function for this, use SUMIF.

    =ARRAYFORMULA(SUMIF(DatenTime!O:O&DatenTime!N:N,O10:O&N10:N,DatenTime!L:L))