By using SUMPRODUCT and MONTH functions jointly, we can calculate the sum of desired ranges based on months. For example,

Formula:

Result:

For sum based on August in cell E8, select 8 instead of 7.

Result:

## How this formula works

In the above example, the formula is:

=SUMPRODUCT(**(MONTH(A5:A11)=7)***B5:B11)

where,

**(MONTH(A5:A11)=7)** is the MONTH function and 7 is used to command Excel for selection of the month July,

**B5:B11 **contains the values that you want to sum, and,

**A5:A11 **are cells containing dates.