# PERCENTOF Function

> Calculate the share of a subset in a total with the PERCENTOF formula function of TX Sheet Control: sums of both ranges, ignored text and the #DIV/0! error.

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

---

Return the share of a subset in the total of all values. `data_subset` holds the values of the part and `data_all` the values of the whole; the result is the sum of `data_subset` divided by the sum of `data_all`, as a fraction. Text is ignored, and a whole that sums to 0 returns `#DIV/0!`.

### Syntax

```text
PERCENTOF(data_subset, data_all)
```

Category: Statistics. Minimum arguments: 2. Maximum arguments: 2.

Available for supported offline calculation.

### Examples

```text
=PERCENTOF({1,2},{1,2,3})
```

The formula returns 0.5, because 1 + 2 is half of 1 + 2 + 3.

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:** [PERCENTILE.INC Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/percentile-inc/llms-full.txt)
- **Next:** [PERCENTRANK Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/percentrank/llms-full.txt)
