# How to sum across columns between two dates in Excel

Use SUMIFS sideways, with the date header row as the criteria range: `=SUMIFS(B2:G2,$B$1:$G$1,">="&$K$1,$B$1:$G$1,"<="&$K$2)`.

**Excel:** `=SUMIFS(B2:G2,$B$1:$G$1,">="&$K$1,$B$1:$G$1,"<="&$K$2)` (Every current version)

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

## Example

Sample data (row 1 is the header):

| A | B | C | D | E | F | G | H | I | J | K |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Line | 2026-01-05 | 2026-01-12 | 2026-01-19 | 2026-01-26 | 2026-02-02 | 2026-02-09 | Total |  | From | 2026-01-12 |
| Hours | 120 | 135 | 128 | 140 | 132 | 126 |  |  | To | 2026-02-02 |
| Overtime | 6 | 9 | 4 | 12 | 7 | 5 |  |  |  |  |
| Contractors | 32 | 30 | 36 | 28 | 34 | 38 |  |  |  |  |

Formula in H2, filled to H4: `=SUMIFS(B2:G2,$B$1:$G$1,">="&$K$1,$B$1:$G$1,"<="&$K$2)`

Result: 535; 32; 128

## How it works

SUMIFS doesn't care whether its ranges run down or across. The header row `$B$1:$G$1` holds the week dates, so two date conditions on it pick the weeks from January 12 to February 2, and the sum range `B2:G2` is the row to add. The headers and inputs are locked, so filling down only moves the row.

## Other ways

- `=SUMPRODUCT(($B$1:$G$1>=$K$1)*($B$1:$G$1<=$K$2)*B2:G2)`: The same window as two tests on the header row.

## Common mistakes

- The sum range and the header range must be the same width, and both must be rows. A column-shaped criteria range with a row-shaped sum range gives #VALUE!.
- Headers typed as text ("Jan 5") are not dates. Enter real dates and format them.

## Questions

**How do I sum the columns for one month?**

Use the first of the month and EOMONTH: `">="&K1` and `"<="&EOMONTH(K1,0)`.

**How do I sum columns by header text instead?**

Use SUMIF across the header row: `=SUMIF($B$1:$G$1,"Actual",B2:G2)`.

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/sum-across-columns-between-two-dates
