HomeGoogle DocsSpreadsheetExtract Quarter from a Date in Google Sheets - Formula Options

Extract Quarter from a Date in Google Sheets – Formula Options

Published on

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.

Create a Calendar in Excel with a One-Line Dynamic Array Formula

This tutorial explains how to create a calendar in Excel using a one-line formula...

Excel: Month Name to Number & Number to Name

This tutorial showcases the most efficient formulas for converting a month name to a...

Get the First or Last Row/Column in a New Google Sheets Table

If you've recently started using the new Google Sheets TABLE functionality, you may find...

UNIQUE Function in Visible Rows in Google Sheets

The UNIQUE function doesn't inherently include only visible rows when it returns values, discarding...

More like this

Get the First or Last Row/Column in a New Google Sheets Table

If you've recently started using the new Google Sheets TABLE functionality, you may find...

UNIQUE Function in Visible Rows in Google Sheets

The UNIQUE function doesn't inherently include only visible rows when it returns values, discarding...

Customizing Alternating Colors of a Table in Google Sheets

Google Sheets' new table feature offers limited options for customizing colors. While you can...

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.