QUERY Dates by Month Name in Google Sheets

Published on

QUERY dates by month name means filtering a date column by the month’s name (like “January” or “June”) instead of using the month number in Google Sheets.

This approach is especially helpful when you’re working with drop-downs containing month names from January to December, rather than month numbers from 1 to 12. Just a quick note: when you query dates using month numbers, Google Sheets treats months as 0 to 11 — where 0 is January and 11 is December — not 1 to 12.

One of the key advantages of querying dates by month name is its clarity for users. A month name in a dropdown is generally more readable and user-friendly than a number.

How to QUERY Dates by Month Name in Google Sheets?

To QUERY dates by month name in Google Sheets, we first need to convert the month name criterion into a month number. For example, if you want to filter by “June”, you can use:

=MONTH("June"&1)

This will return the month number 6.

Why does that work?

When you write "June"&1, it becomes "June1", which Google Sheets interprets as a date like June 1 of the current year (e.g., 01/06/2025). The MONTH function then extracts the number 6 from that date. We only care about the month here, not the year.

For more on this, check out: Convert Month Name to Month Number in Google Sheets

Using It in QUERY

Now let’s look at how to use this in a QUERY formula to filter dates by month name.

Example: QUERY Dates by Month Name in Google Sheets

Assume:

  • Column A contains sales dates.
  • Column B contains sales quantities.

You want to filter for all transactions that occurred in January.

Using Month Number:

=QUERY(A1:B, "Select * where month(A)+1=1", 1)

Why month(A)+1?
Because the MONTH function in QUERY returns months as 0 (Jan) to 11 (Dec), so we add 1 to make it more intuitive (1 to 12).

QUERY by Month Name:

Start by isolating the month number like this:

=QUERY(A1:B, "Select * where month(A)+1="&1, 1)

Now, replace the number 1 with a formula that converts a month name to a number. For example, using “January”:

=QUERY(A1:B, "Select * where month(A)+1="&MONTH("January"&1), 1)

That’s how you filter a date column by month name in a QUERY formula in Google Sheets.

What if the Month Name Is in a Cell?

In most practical cases, you’ll be using a dropdown or cell reference for the month name. Suppose you have a dropdown in cell D1 with month names from January to December. You can plug that into the formula like this:

=QUERY(A1:B, "Select * where month(A)+1="&MONTH(D1&1), 1)
Example of QUERY formula filtering a date column by month name in Google Sheets

Filter Date Column by Month Name and Year

If your data spans multiple years, you might want to filter by both month name and year.

For example, to filter for January 2025:

=QUERY(A1:B, "Select * where month(A)+1="&MONTH("January"&1)&" and year(A)=2025", 1)

If the month name is in D1 and the year is in D2, the formula would be:

=QUERY(A1:B, "Select * where month(A)+1="&MONTH(D1&1)&" and year(A)="&D2, 1)

FAQs

Can I Use Abbreviated Month Names?

Yes, you can! The formula works the same way. Just make sure to use standard three-letter abbreviations like Jan, Feb, Mar, etc.

Does the December Month Issue Affect This?

Nope! An empty cell returns month number 12 by default, but since we’re not modifying the original date values directly, the formula won’t mistakenly include empty rows.

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Calculate Trip Days by Month (Start, End, and Full Days) in Google Sheets

If you're managing business travel in Google Sheets, you may need to calculate how...

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

More like this

Calculate Trip Days by Month (Start, End, and Full Days) in Google Sheets

If you're managing business travel in Google Sheets, you may need to calculate how...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

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.