I want a formula which sums column D
if column K
has a value between 3000 and 4000. I've tried the following but none work:
=SUMIF(K3:K67; ">= 3000 & < 4000";D3:D67)
=SUMIF(K3:K67; ">= 3000 " & " < 4000";D3:D67)
=SUMIF(K3:K67; ">= 3000 AND < 4000";D3:D67)
Is this possible or must I use the ArrayFormula function (which I don't understand) like in this question?
Edit: This works, so there's nothing wrong with the data:
=SUMIF(K3:K67; ">= 3000";D3:D67)
Edit: Google Sheets now supports SUMIFS.
Original answer: There are a number of ways to do this. A little while ago I spent some time working out which method is the most watertight (for example, I am guessing the formula in the original post of the question you linked may have failed because there were probably text entries - perhaps a header - in the column to be summed).
IMO this is the most watertight general solution for a multi-conditional sum in Google Sheets:
=SUM(IFERROR(FILTER(sum_range;condition_1;condition_2;...)))
so in your specific case:
=SUM(IFERROR(FILTER(D3:D67;K3:K67>=3000;K3:K67<4000)))
Although the same can be achieved with the following:
=SUMIF(K3:K67;"<4000";D3:D67)-SUMIF(K3:K67;"<3000";D3:D67)
but I guess these "in-between" conditions are a special case where you can do this; the first solution is perhaps a better general solution.
The answer of this question is deprecated since SUMIFS is now included, adding support to multiple criterias to SUMIF
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With