How to get the quarter from a date
✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)Work out which quarter (1–4) a date falls in, for grouping and reporting.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel (desktop) | =ROUNDUP(MONTH(A2)/3,0) | Prepend text if you want a label: ="Q"&ROUNDUP(MONTH(A2)/3,0). |
| Google Sheets | =ROUNDUP(MONTH(A2)/3,0) | Identical. |
| LibreOffice Calc | =ROUNDUP(MONTH(A2)/3,0) | Identical. |
How it works
MONTH gives 1–12; dividing by 3 and rounding up maps months 1–3 to quarter 1, 4–6 to 2, and so on — July is month 7, so 7/3 = 2.33 rounds up to quarter 3. For a fiscal year that doesn't start in January, shift the month first, e.g. =ROUNDUP(MOD(MONTH(A2)-4,12)/3+0.01,0) for an April start — or simpler, use =CHOOSE(MONTH(A2),4,4,4,1,1,1,2,2,2,3,3,3).
Verified, not just documented
We ran =ROUNDUP(MONTH(DATE(2026,7,21))/3,0) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 3 — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 3 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.
Functions used
ROUNDUP · MONTH — see full Excel, Google Sheets & LibreOffice compatibility for each.
Related recipes
- How to create a quarter-and-year label like "Q3 2026"
- How to check if a year is a leap year
- How to get the quarter-end date for any date
- How to sum values by month