HomeGoogle DocsSpreadsheetFormula to Group Dates by Quarter in Google Sheets

Formula to Group Dates by Quarter in Google Sheets

Published on

Here I have one Query formula that can help you to group dates by Quarter in Google Sheets. The formula is so simple so you can easily adapt it for your purpose.

In Google Sheets, you can group your date column by the quarter like Quarter 1, 2, 3, and 4 either by using a Query formula or the Pivot Table.

In this grouping, if the date column has the dates that span across different years, you can consider a year-quarter wise grouping also.

The Pivot Table is the quickest and suggestible solution for novice Google Sheets users for grouping the date column.

Personally, I think it’s not suitable for all the situations as the Pivot Table in Google Sheets creates a new tab.

Must Read: Month, Quarter, Year Wise Grouping in Pivot Table in Google Sheets

Before providing you the Query-based formula to group dates by Quarter in Google Sheets, see this basic dataset and the formula output.

Group Dates by Quarter in Google Sheets

How to Group Dates by Quarter in Google Sheets? Example

Here is that Query formula in Cell E1, that groups dates by Quarter in Google Sheets.

=query({A1:B},"Select quarter(Col1),sum(Col2) where Col1 is not null group by quarter(Col1)")

The highlight of this Query formula is the use of the Quarter Scalar function in Google Sheets Query.

Similar to the Year and Month scalar function, you can use the Quarter scalar function in both the Group Clause and as well as in the Select clause. That is what I’ve done above.

We want the Query formula to group the dates by the Quarter. So instead of selecting dates, in the Query Select clause, we should select the Quarter of the dates in Column A. Then Group, not the dates, but the Quarter of the dates.

Can I Group Dates by Quarter-Year / Year-Quarter in Google Sheets?

Yes! For example, I have my dates in column 1 (A2: A), span across two different years like 2018 and 2019. Here I can group the dates Quart-year wise as follows.

Group Dates by Quarter-Year

The Formula in G1:

=query({A1:B1},"Select quarter(Col1),year(Col1), sum(Col2) where Col1 is not null group by quarter(Col1),year(Col1)")

The procedure to do a Quarter-wise grouping or a Year-Quarter wise grouping is almost the same.

In both cases, you should use the scalar functions in the select clause as well as in the group clause as explained.

Open a blank spreadsheet and experiment with my formulas that can group dates by Quarter in Google Sheets.

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Running Total By Month in Excel

This tutorial demonstrates how to calculate the running total by month in a range...

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

More like this

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.