# REPLACEB Function

> Replace part of a text by byte position with REPLACEB in TX Sheet Control, which counts one byte per character and returns the same result as REPLACE.

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

---

Replace part of a text, given by its position in bytes. The four arguments are those of [REPLACE](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/replace/llms-full.txt): the text, the position of the first byte to replace, the number of bytes to replace and the text to insert. TX Sheet Control counts every character as one byte, including double-byte characters such as Japanese, so REPLACEB returns the same as REPLACE. A start position less than 1 or a negative number of bytes returns `#VALUE!`.

### Syntax

```text
REPLACEB(text, argument1, argument2)
```

Category: Text. Minimum arguments: 4. Maximum arguments: 4.

Available for supported offline calculation.

### Examples

```text
=REPLACEB("abc",2,1,"X")
```

The formula returns aXc.

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:** [REPLACE Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/replace/llms-full.txt)
- **Next:** [REPT Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/rept/llms-full.txt)
