Skip to content

How to sum values by month in Excel in Excel

Total sales for each month from a list of dated transactions with SUMIFS and date boundaries, or group by month in a PivotTable.

A list of transactions has a date on every row and you want one total per month.

The reliable formula method is SUMIFS with two date conditions: on or after the first day of the month, and before the first day of the next. Write the month as a real date, such as 1 Jan 2025 formatted as "mmm yyyy", and let the formula work out the boundaries.

=SUMIFS($B$2:$B$13, $A$2:$A$13, ">="&D2, $A$2:$A$13, "<"&EDATE(D2,1))

The ampersand joins the operator, written as text, to the date in D2. EDATE adds one month to get the start of the next month. Using "less than the next month" instead of "up to the last day" is safer, because it also catches dates that carry a time of day.

Lock the ranges with $ so the formula can be filled down, and leave the month reference relative so each row picks up its own month.

A common shortcut is =SUMPRODUCT((MONTH(A2:A13)=1)*B2:B13). It works, but it adds every January, from every year in the data. Add a year test if the list spans more than twelve months.

For a one-off summary, a PivotTable is quicker: choose Insert > PivotTable, put the date in Rows and the amount in Values. Right-click a date, choose Group, and select Months (and Years). The Analysis track shows how to build a full summary table with formulas.

2 ways to do it

1SUMIFS with date boundaries

=SUMIFS($B$2:$B$13,$A$2:$A$13,">="&D2,$A$2:$A$13,"<"&EDATE(D2,1))

  1. List the first day of each month in column D, formatted as mmm yyyy.
  2. In E2 total the amounts where the date is on or after D2 and before the next month, found with EDATE.
  3. Lock the ranges with $ and fill the formula down.

2PivotTable grouped by month

  1. Select the data and choose Insert > PivotTable, then OK.
  2. Drag the date field to Rows and the amount field to Values.
  3. Right-click any date in the PivotTable, choose Group, select Months (add Years if the data spans years), and select OK.

Try it yourself

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In E2, total the sales whose date falls in the month in D2, then fill down to E4. Lock the ranges so the formula fills correctly.

Answer in E2, then it fills down to E4.

E2
A
B
C
D
E
F
1
Date
Sales
Month
Sales total
Sales count
2
03-Feb-2025
1,500
Jan 2025
3
05-Mar-2025
1,100
Feb 2025
4
06-Jan-2025
1,200
Mar 2025
5
14-Feb-2025
720
6
12-Mar-2025
640
7
21-Jan-2025
860
8
20-Feb-2025
980
9
19-Mar-2025
1,750
10
30-Jan-2025
450
11
28-Feb-2025
310
12
26-Mar-2025
520
13
31-Mar-2025
900

Learn it properly, one graded sheet at a time.

Data analysis with formulas covers this in lesson 1, SUMIFS: totals by group.