Table of Contents
The process of grouping data by month and year in a pivot table using Excel involves organizing data from a larger dataset into specific time periods, such as months and years. This can be achieved by creating a pivot table, which is a powerful tool in Excel that allows for the manipulation and analysis of data in a structured and organized manner. By using the group function in the pivot table, the data can be grouped by month and year, allowing for a more comprehensive and concise understanding of trends and patterns within the data. This approach can be particularly useful for financial or sales data, where analyzing data by specific time periods is essential for making informed decisions.
Excel: Group by Month and Year in Pivot Table
Often you may want to group data by month and year in a pivot table in Excel.
Fortunately this is easy to do using the pivot table Group function.
The following example shows how to use this function in practice.
Example: Group by Month and Year in Pivot Table
Suppose we have the following dataset in Excel that shows the total sales made by some company during various days:

To group the sales by month and year, we can first create a pivot table.
Highlight the cells in the range A1:B12, then click the Insert tab along the top ribbon, then click PivotTable.
In the new window that appears, we’ll choose to insert the Pivot Table in cell D1 of the current worksheet:

In the window that appears on the right side of the screen, drag Date to Rows and Sales to Values:

The following pivot table will automatically be populated:

To group the data by month and year, right click on any of the dates in the pivot table.
Then click Group in the dropdown menu.


The sales in the pivot table will automatically be grouped by month and year:

We can now see the sum of sales, grouped by month and year.
For example:
- A total of 11 sales were made in January 2021.
- A total of 12 sales were made in February 2021.
And so on.
Additional Resources
The following tutorials explain how to perform other common operations in Excel:
Cite this article
stats writer (2024). How can I group data by month and year in a pivot table using Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-group-data-by-month-and-year-in-a-pivot-table-using-excel/
stats writer. "How can I group data by month and year in a pivot table using Excel?." PSYCHOLOGICAL SCALES, 1 Jul. 2024, https://scales.arabpsychology.com/stats/how-can-i-group-data-by-month-and-year-in-a-pivot-table-using-excel/.
stats writer. "How can I group data by month and year in a pivot table using Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-group-data-by-month-and-year-in-a-pivot-table-using-excel/.
stats writer (2024) 'How can I group data by month and year in a pivot table using Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-group-data-by-month-and-year-in-a-pivot-table-using-excel/.
[1] stats writer, "How can I group data by month and year in a pivot table using Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, July, 2024.
stats writer. How can I group data by month and year in a pivot table using Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
