Two Ways to Calculate Monthly Totals in Excel
To total one year of data by month in Excel, extract the month with MONTH and sum the amounts with SUMIF. If your data spans multiple years, use SUMIFS from the first day of the month up to, but excluding, the first day of the next month. This keeps January 2019 separate from January 2020.
Set up the sample data
Enter the data below in A1:E10. Column A holds dates and column E holds the amounts to sum. Convert any dates imported as text to date values, and make sure sales are stored as numbers. January 2019 totals 1600. February and March each total 1400.
| Date | Product | Unit price | Quantity | Sales |
|---|---|---|---|---|
| 2019-01-02 | A | 100 | 4 | 400 |
| 2019-01-05 | B | 200 | 3 | 600 |
| 2019-01-06 | C | 300 | 2 | 600 |
| 2019-02-01 | D | 400 | 1 | 400 |
| 2019-02-04 | A | 100 | 4 | 400 |
| 2019-02-07 | B | 200 | 3 | 600 |
| 2019-03-03 | C | 300 | 2 | 600 |
| 2019-03-06 | D | 400 | 1 | 400 |
| 2019-03-07 | A | 100 | 4 | 400 |
Use MONTH and SUMIF to total by month number
The formula argument separator is a comma or a semicolon, depending on your Excel regional settings.
Enter the first formula in F2 and fill it down to F10. It extracts the month from the date in column A, so January rows show 1.
=MONTH(A2)
Enter 1, 2, and 3 in H2:H4. Enter the second formula in I2 and fill down through I4. The ranges with dollar signs stay fixed while H2 changes to H3 and H4. Check for 1600, 1400, and 1400 in I2:I4.
=SUMIF($F$2:$F$10,H2,$E$2:$E$10)
Use SUMIFS with a month start date
Enter January 1, 2019 as a real date in J2, for example using the first formula below. Enter the next formula in K2.
=DATE(2019,1,1)
=SUMIFS($E$2:$E$10,$A$2:$A$10,">="&J2,$A$2:$A$10,"<"&DATE(YEAR(J2),MONTH(J2)+1,1))
The formula includes dates on or after J2 and before the first day of the following month. It returns 1600 for January. Put February 1, 2019 in J3 and fill down from K2 to get 1400. A sale late on January 31 is included, while a sale at midnight on February 1 goes into February.
What happens when you add another year?
Put January 2, 2020 in A11 and 900 in E11. Fill the helper formula into F11 and extend the source ranges in both total formulas to row 11. The total by month number is now 2500 for January, while the January 2019 date-range total stays 1600.
The SUMPRODUCT formula below also matches on month number without a helper column, so it combines January rows from different years. Use SUMIFS for a specific year and month. If a total does not match, filter the source rows and check that the ranges end on the same row.
=SUMPRODUCT((MONTH($A$2:$A$10)=H2)*$E$2:$E$10)




