Extract Quarter from a Date in Google Sheets – Formula Options

The Quarter() is one of the scalar functions in Google Sheets Query. There is no such function that you can use directly within a cell in Sheets. So in order to extract the quarter from a date in Google Sheets, you can use a custom formula.

There are four quarters in a year that means each quarter consists of 3 months (12/4). It would be like;

  • Jan to Mar – Q1
  • Apr to Jun – Q2
  • Jul to Sep – Q3
  • Oct to Dec – Q4

I’ll explain to you how to extract a quarter from a date (non-array formula) and also extract quarters from a date range (array formula).

Non-Array Formula to Return Quarter from a Date in Google Sheets

The date 26/06/2019 falls in quarter 2, right? From this date, I want to return the corresponding quarter 2 using a formula. Assume this date is in cell C2.

Here is the formula to extract the quarter from the above date in Google Sheets. I have used the ROUNDUP and MONTH functions for this.

=ROUNDUP(month(C2)/3,0)

Sometimes you may want to add the string “Q” or “Quarter” to the above output. You can use the below formula for that.

="Quarter "&ROUNDUP(month(C2)/3,0)

In this change “Quarter” to “Q” to return Q2.

Array Formula to Return Quarter from a Date Range in Google Sheets

If you have a date range in C2:C5, you can simply copy the quarter formula in cell D2 to the range D3:D5. What about converting the quarter formula to an array formula?

Quarter ArrayFormula:

=ArrayFormula("Quarter "&ROUNDUP(month(C2:C5)/3,0))
Extract Quarter from a Date in Google Sheets

Here is the same formula for an infinite range.

=ArrayFormula(if(C2:C<>"","Quarter "&ROUNDUP(month(C2:C)/3,0),))

Date Range to Quarter Using Query Quarter Function

Since the Query function has the Quarter function built-in, instead of the above array formula, you can use the Query in Google Sheets.

You can easily replace the above Quarter array formula with the following Query.

=query(C2:C,"Select quarter(C) label quarter(C)''")

If you want to summarise your data by Quarterly, the better way is to use the Quarter function in Query. Here is one example – Formula to Group Dates by Quarter in Google Sheets.

That’s all about the date to quarter conversion in Sheets. Enjoy!

Additional Resources:

  1. Month, Quarter, Year Wise Grouping in Pivot Table in Google Sheets.
  2. Query to Create Daily/Weekly/Monthly/Quarterly/Yearly Report Summary in Google Sheets.
  3. Weekday Name to Weekday Number in Google Sheets.
  4. Formula to Convert Month Name in Text to Month Number in Google Sheets.
  5. Google Sheets Query: How to Convert Month in Number to Month Name in Text.
  6. Convert Numbers to Month Name 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.

Lookup Values Under Categories in Excel and Google Sheets

We can use a combination of XLOOKUP and VLOOKUP in both Excel and Google...

Extract Items Under a Category from the Same Column in Excel

In Excel, you can use a combination of the XLOOKUP and DROP functions to...

How to Create a Searchable Table in Excel Using the FILTER Function

Finding specific records, or rows containing the required information, is straightforward in Excel using...

Time Sequences in Excel by Minute, Hour, or Second Increments

Creating time sequences, whether by hour, minute, or second increments in Excel, can be...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

2 COMMENTS

  1. How might I split data across a date range by quarter? Example:

    Data: sold 150 units during the date range from Jan 15 to July 15.
    Query: On average, how many were sold in Q1, Q2, Q3, and Q4?

    Answer: Q1: 50 Q2: 50 Q3: 50 Q4: 0

    • Hi, Roger Brownlie,

      You can either use a Query Formula or a Pivot Table.

      Please search “Formula to Group Dates by Quarter in Google Sheets” within this tutorial to find the relevant tutorial.

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.