# HEX2OCT Function

> Convert a hexadecimal number to octal with HEX2OCT in TX Sheet Control: two's complement for negative numbers, the valid range, places and #NUM! errors.

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

---

Convert a hexadecimal number to octal. `number` is the hexadecimal number of up to 10 characters, in which a value from FFE0000000 to FFFFFFFFFF is negative in two's complement; the valid range is FFE0000000 to 1FFFFFFF. `places` pads the result with leading zeros. A number out of range, an invalid hexadecimal number or too few `places` returns `#NUM!`.

### Syntax

```text
HEX2OCT(number, places)
```

Category: Engineering. Minimum arguments: 1. Maximum arguments: 2.

Available for supported offline calculation.

### Examples

```text
=HEX2OCT(10)
```

The formula returns the text 20, the octal form of 16.

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:** [HEX2DEC Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/hex2dec/llms-full.txt)
- **Next:** [HLOOKUP Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/hlookup/llms-full.txt)
