# How to get the quarter from a date in Excel

Divide the month by 3 and round up: `="Q"&ROUNDUP(MONTH(A2)/3,0)`.

**Excel:** `="Q"&ROUNDUP(MONTH(A2)/3,0)` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Date | Quarter |
| 2026-01-15 |  |
| 2026-03-31 |  |
| 2026-04-01 |  |
| 2026-08-19 |  |
| 2026-10-02 |  |
| 2026-12-31 |  |

Formula in B2, filled to B7: `="Q"&ROUNDUP(MONTH(A2)/3,0)`

Result: Q1; Q1; Q2; Q3; Q4; Q4

## 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.

## Other ways

- `=ROUNDUP(MONTH(A2)/3,0)`: Just the number, for grouping and math. (A number from 1 to 4.)
- `="Q"&INT((MONTH(A2)+2)/3)`: The same result with INT.
- `="Q"&ROUNDUP(MONTH(A2)/3,0)&" "&YEAR(A2)`: 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.

## 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.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/quarter-from-a-date
