Excel Conditional Sum

2019-07-07 13:28发布

问题:

Sorry guys i'm a excel novice on dynamic formulas... but basically i'm trying to do a conditional sum using a different column condition for the condition and if the condition checks out use the value in another column

I want sum(b1:b4) but only when the value in column A meets a condition... So lets say i only want to sum the values in the range if the value in the A column = 3 ...

Hopefully that is clear. Thank you in advance for the help.

回答1:

You can use SUMIF for that.

=SUMIF(A1:A4, 3, B1:B4)

What it means, is, sum the range B1:B4 if range A1:A4 is equal to 3. Of course, it applies the condition on a row to row basis just like what you're looking for.