How to get the quarter from a date in Excel
Formula (Excel and Google Sheets)
="Q"&ROUNDUP(MONTH(A2)/3,0)Divide the month by 3 and round up: ="Q"&ROUNDUP(MONTH(A2)/3,0).
- Result on the example
- one result per row in
B2, filled down toB7 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in B2, filled down to B7. Change any input and the result updates, or edit the formula to experiment.
How it works
Dividing the month number by 3 gives 0.33 to 1 for January to March, 1.33 to 2 for April to June, and so on. ROUNDUP turns that into 1 to 4, and "Q"& adds the label.
="Q"&ROUNDUP(MONTH(A2)/3,0)In Google Sheets
The same formula works in Google Sheets: ="Q"&ROUNDUP(MONTH(A2)/3,0). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =ROUNDUP(MONTH(A2)/3,0) | 1, 1, 2…Different result | Just the number, for grouping and math. A number from 1 to 4. |
| ="Q"&INT((MONTH(A2)+2)/3) | Q1, Q1, Q2… | The same result with INT. |
| ="Q"&ROUNDUP(MONTH(A2)/3,0)&" "&YEAR(A2) | Q1 2026, Q1 2026, Q2 2026…Different result | Adds the year, so Q1 2026 and Q1 2027 stay apart. Includes the year. |
Common mistakes
- TEXT has no quarter code:
TEXT(A2,"q")returns the letter q. - The quarter alone mixes years. Add the year when the data spans more than one.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Get the quarter from a date
B2, show the calendar quarter of each date as Q1 to Q4, and fill down to B7.Questions
How do I get the fiscal quarter when the year starts in July?
="Q"&INT(MOD(MONTH(A2)-7,12)/3)+1.
How do I sum by quarter?
Add the quarter as a helper column and use SUMIFS, or SUMPRODUCT with ROUNDUP(MONTH(dates)/3,0)=1 as the test.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.