The first approach is a self-contained formula based on the SUMPRODUCT function.
The second method uses SUMIF with column D as a helper column.
Either approach will work correctly, and the best option depends on personal preference.
The formula in cell D5 is:
This formula isexplained in detail here.
Finally, SUMPRODUCT returns the sum of all items in the array, 7700.
In contrast, the SUMPRODUCT option is self-contained.
We can’t build a similar self-contained formula with SUMIF because ofinnate limitations of the function.
SUMPRODUCT Function
The Excel SUMPRODUCT function multipliesrangesorarraystogether and returns the sum of products.
Criteria can be applied to dates, numbers, and text.