Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to SUMIF with an array in Google Sheets

I can not get this calculation to work.

=SUMIF({C3,E3,G3,I3,K3,M3},"N",{D3,F3,H3,J3,L3,N3})

The array as the RANGE works fine but the array as the SUM_RANGE returns the error message:

Argument must be a range

Can anyone help me?

Thanks, Dean.

like image 215
Dean van Dijk Avatar asked Oct 20 '25 03:10

Dean van Dijk


2 Answers

Please try filter with offset:

=SUM(FILTER(D3:N3,C3:M3="B"))

enter image description here

why it's better:

  • you use the entire ranges.
  • the formula is shorter
  • easy to add other conditions in a filter.

Edit

See also sumif with offset:

=SUMIF(C3:M3,"B",D3:N3)

like image 76
Max Makhrov Avatar answered Oct 22 '25 04:10

Max Makhrov


Not tested but see if this works

=SUMPRODUCT({C3,E3,G3,I3,K3,M3}="N",{D3,F3,H3,J3,L3,N3})
like image 32
JPV Avatar answered Oct 22 '25 04:10

JPV



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!