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
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.
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.