# How to count cells between two dates in Excel

Use COUNTIFS with two conditions on the same date column: on or after the start date, and on or before the end date.

**Excel:** `=COUNTIFS(B2:B11,">="&G1,B2:B11,"<="&G2)` (Every current version)

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

## Example

Sample data (row 1 is the header):

| A | B | C | D | E | F | G |
| --- | --- | --- | --- | --- | --- | --- |
| Order | Date | Region | Amount |  | Start | 2026-03-01 |
| A-1001 | 2026-02-14 | East | 420 |  | End | 2026-03-31 |
| A-1002 | 2026-02-27 | West | 1250 |  | Orders in range |  |
| A-1003 | 2026-03-02 | East | 310 |  |  |  |
| A-1004 | 2026-03-09 | North | 880 |  |  |  |
| A-1005 | 2026-03-15 | West | 1460 |  |  |  |
| A-1006 | 2026-03-15 | East | 95 |  |  |  |
| A-1007 | 2026-03-22 | South | 730 |  |  |  |
| A-1008 | 2026-03-31 | North | 515 |  |  |  |
| A-1009 | 2026-04-01 | East | 640 |  |  |  |
| A-1010 | 2026-04-12 | West | 205 |  |  |  |

Formula in G3: `=COUNTIFS(B2:B11,">="&G1,B2:B11,"<="&G2)`

Result: 6

## How it works

COUNTIFS counts a row only when every condition is true, so two conditions on the same column make a range: `">="&G1` keeps dates on or after the start, and `"<="&G2` keeps dates on or before the end. The `&` joins the operator to the date in the cell, which is what lets you change the dates without touching the formula.

Dates are numbers underneath, so the comparison works on the real date, not the way it is displayed.

## Other ways

- `=SUMPRODUCT((B2:B11>=G1)*(B2:B11<=G2))`: Works in every version, and lets you add conditions COUNTIFS can't express, like a test on MONTH(B2:B11).
- `=COUNTIFS(B2:B11,">"&G1,B2:B11,"<"&G2)`: Use > and < when the start and end dates themselves should not count. (Leaves out orders dated exactly on G1 or G2.)

## Common mistakes

- Typing the date inside the quotes, like `">=3/1/2026"`, works only in date formats that match your computer's settings. Keep dates in cells and join them with `&`.
- Dates with times (a timestamp like 3/31/2026 4:30 PM) are larger than the plain date, so `"<="&G2` misses them. Use `"<"&G2+1` to include the whole last day.
- Dates stored as text don't count. If the dates sit on the left of the cell, convert them first.

## Questions

**How do I count between two dates and another condition?**

Add another pair to COUNTIFS, for example `=COUNTIFS(B2:B11,">="&G1,B2:B11,"<="&G2,C2:C11,"East")`.

**How do I count dates in one month?**

Put the first day of the month in G1 and use `EOMONTH(G1,0)` for the end: `=COUNTIFS(B2:B11,">="&G1,B2:B11,"<="&EOMONTH(G1,0))`.

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

Source: https://spreadsheetpractice.com/formulas/count-cells-between-two-dates
