# HOUR function in Excel

> HOUR returns the hour of a time as a number from 0 to 23, so 1:45 PM gives 13.

Source: https://spreadsheetpractice.com/functions/hour · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on October 30, 2026

## Quick answer

- **What it does:** HOUR returns the hour of a time as a number from 0 to 23, so 1:45 PM gives 13.
- **Syntax:** `=HOUR(serial_number)`
- **Most common use:** `=HOUR(A2)` returns 13 (The time part of 1/5/2026 1:45 PM: 13)
- **Available in:** Every current version
- **Category:** [Date functions](https://spreadsheetpractice.com/functions/category/date)
- **Returns:** A whole number from 0 to 23.
- **Google Sheets:** Works the same in Google Sheets.

## What it does

HOUR returns the hour of a time as a number from 0 to 23, so 1:45 PM gives 13. Use it to bucket timestamps by hour, flag late check-ins or count orders per hour. It reads the time part of a date and time, and also accepts times typed as text, like "1:45 PM".

## Syntax

`=HOUR(serial_number)`

| Argument | Required? | What it is |
|---|---|---|
| `serial_number` | Required | A time, a date and time, or time text. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| B2 | `=HOUR(A2)` | 13 | The time part of 1/5/2026 1:45 PM: 13 |
| B3 | `=HOUR(A3)` | 7 | 7:30 AM is hour 7 |
| B4 | `=HOUR(A4)` | 18 | Time typed as text works too: 18 |

### The sample sheet

Every formula above runs on this data:

|  | A | B |
|---|---|---|
| 1 | Timestamp | Result |
| 2 | 1/5/2026 13:45:00 | 13 |
| 3 | 7:30 AM | 7 |
| 4 | 6:05 PM | 18 |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| #VALUE! | The cell holds text that isn't a time. Look for stray characters. |
| Always 0 | The cell holds a date with no time, which is midnight. |

## Tips

- =SUMPRODUCT(--(HOUR(A2:A100)=9)) counts timestamps in the 9 AM hour without a helper column.

## Related functions

- [MINUTE](https://spreadsheetpractice.com/functions/minute): MINUTE returns the minutes part of a time as a number from 0 to 59, so 1:45 PM gives 45.
- [SECOND](https://spreadsheetpractice.com/functions/second): SECOND returns the seconds part of a time as a number from 0 to 59.
- [TIME](https://spreadsheetpractice.com/functions/time): TIME builds a time from hours, minutes and seconds, such as TIME(13,30,0) for 1:30 PM.

## Questions

### How do I extract the hour from a time in Excel?

=HOUR(A2) returns 0–23. =TEXT(A2,"h AM/PM") gives a label like 1 PM.

### How do I turn a time into decimal hours?

=A2*24 turns a time into hours as a decimal: 1:30 becomes 1.5.

## Practice

A graded HOUR exercise ("Hour of each order") is on [the HOUR page](https://spreadsheetpractice.com/functions/hour). It is checked instantly, then re-checked on changed data.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
