Sum values by month (with or without year) in Excel
This tutorial demonstrates two formulas in detail to help summing values by certain month and year or summing values by certain month ignore year in Excel.
How to sum values by month and year?
How to sum values by month ignore year?
How to sum values by month and year?
As shown in the screenshot below, to sum the total amount based on October from the same year (2019), you can use a formula with the SUMIFS and EOMONTH functions.
Generic Formulas
=SUMIFS(value_range,date_range,">="&date,date_range,"<="&EOMONTH(date,0))
Arguments
How to use this formula?
In this case, $D$3:$D$11 is the range1, China is the criteria1 that locates in $G3, $E$3:$E$11 is the range2, and H$2 is the cell reference containing the criteria2.
1. Select a blank cell to output the result. In this case, I select H6.
2. Copy or enter the below formula into the selected cell and press the Enter key. Select the result cell, drag the AutoFill Handle down to get the sum by other month and year.
=SUMIFS($E$5:$E$10,$B$5:$B$10,">="&G6,$B$5:$B$10,"<="&EOMONTH(G6,0))
Note: In range G6:G7, I entered actual dates in “m/d/yyyy” format into the cells and then manually formatted the dates as “mmm-yyyy” to only display the month and year. If you manually enter the month and year as text into the cell, you will not get the correct result.
Explanation of the formula
=SUMIFS($E$5:$E$10,$B$5:$B$10,">="&G6,$B$5:$B$10,"<="&EOMONTH(G6,0))
How to sum values by month ignore year?
With the above formula, you can only sum values by month from the same year. To sum values by month from different years, you can apply a formula based on the SUMPROFUCT and MONTH functions.
Generic formula
=SUMPRODUCT((MONTH(date_range)=month)*value_range)
Arguments
How to use this formula?
1. Select a blank cell. Here I select H6.
2. Copy or enter the below formula into it and press the Enter key to get the result.
=SUMPRODUCT((MONTH($B$5:$B$10)=10)*$E$5:$E$10)
Note: In the formula, the number 10 represents the month October. The numbers 1 to 12 separately represent January to December, and you can change it according to your needs.
Explanation of the formula
=SUMPRODUCT((MONTH($B$5:$B$10)=10)*$E$5:$E$10)
Related functions
Excel SUMIFS function
The Excel SUMIFS function helps to sum cell values based on multiple criteria
Excel SUMPRODUCT function
The Excel SUMPRODUCT function can be used to multiply two or more columns or arrays together, and then get the sum of products.
Excel EOMONTH function
The Excel EOMONTH function gets the date that is a specific number of months before or after a given start date
Excel MONTH function
The Excel MONTH function extracts the month number from a date format in Excel
Related formulas
Sum values by the week of a given date
This tutorial talks about how to sum values by the week in which a given date falls
Sum values by weeknum or weekday
This tutorial demonstrates formulas step-by-step to help you sum values in a certain range based on the specified week number or weekday in Excel.
Sum every n rows or columns in a range
This tutorial explains two formulas based on the SUM and OFFSET functions to sum every n rows or columns in a specified range in Excel.
Sum every nth row or column in a range
This tutorial is going to show you how to create a formula based on the SUMPRODUCT, MOD and COLUMN functions to sum every nth row or column in a range in Excel.
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...
Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
- One second to switch between dozens of open documents!
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Increases your productivity by 50% when viewing and editing multiple documents.
- Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.