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.

Table References in Formulas in Google Sheets

When you create a Google Sheets table by inserting custom tables or converting a...

Converting a Range to a Table and Vice Versa in Google Sheets

Google Sheets has recently introduced several features, with one of the latest being the...

EXPAND + Stacking: Expand an Array in Excel

We can expand an array by adding values at the end using the EXPAND...

Convert Month Name to Days in Google Sheets

We can utilize the EOMONTH, MONTH, DATE, and DAY functions in Google Sheets to...

More like this

Table References in Formulas in Google Sheets

When you create a Google Sheets table by inserting custom tables or converting a...

Converting a Range to a Table and Vice Versa in Google Sheets

Google Sheets has recently introduced several features, with one of the latest being the...

Convert Month Name to Days in Google Sheets

We can utilize the EOMONTH, MONTH, DATE, and DAY functions in Google Sheets to...

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.