# WEEKNUM Function

> Return the week number of a date with WEEKNUM in TX Sheet Control: weeks starting on Sunday or Monday, ISO 8601 week numbers with type 21, errors, an example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > WEEKNUM Function
- **218 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/weeknum/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/weeknum/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/weeknum/llms-full.txt

---

Return the week number of a date in the year. `serial_number` is the date. `return_type` sets the day the week starts on: 1 for Sunday (the default), 2 for Monday, 11 to 17 for Monday through Sunday, and 21 for ISO 8601 week numbers, where week 1 is the week with the first Thursday of the year. With the other types, week 1 is the week that contains January 1. Any other `return_type` returns `#NUM!`.

### Syntax

```text
WEEKNUM(serial_number, return_type)
```

Category: Date & Time. Minimum arguments: 1. Maximum arguments: 2.

Available for supported offline calculation.

### Examples

```text
=WEEKNUM(DATE(2026,10,9))
```

The formula returns 41.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [WEEKDAY Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/weekday/llms-full.txt)
- **Next:** [WEIBULL Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/weibull/llms-full.txt)
