# WEEKDAY Function

> Return the day of the week of a date as a number with WEEKDAY in TX Sheet Control: return types 1, 2, 3 and 11 to 17, #NUM! and #VALUE! errors and an example.

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

---

Return the day of the week of a date as a number. `serial_number` is the date. `return_type` selects the numbering: 1 numbers Sunday to Saturday as 1 to 7 (the default), 2 numbers Monday to Sunday as 1 to 7, 3 numbers Monday to Sunday as 0 to 6, and 11 to 17 start the week on Monday through Sunday as 1. Any other `return_type` returns `#NUM!`, and text that is not a date returns `#VALUE!`.

### Syntax

```text
WEEKDAY(serial_number, return_type)
```

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

Available for supported offline calculation.

### Examples

```text
=WEEKDAY(DATE(2026,10,9),2)
```

The formula returns 5: October 9, 2026, is a Friday, the fifth day of a week that starts on Monday.

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:** [WEBSERVICE Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/webservice/llms-full.txt)
- **Next:** [WEEKNUM Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/weeknum/llms-full.txt)
