# PERCENTILEOFVALUE

PERCENTILEOFVALUE(`series 1`, `series 2`)

Returns the percentile of a given value, or series of values, given an input set of data.

### Arguments

| Input          | Description                                 |
| -------------- | ------------------------------------------- |
| `target value` | Target value(s) to return percentile for    |
| `data`         | Series of data to calculate percentile from |

### Outputs

Returns a percentile or series of percentiles.

### Example

Let's say we have a series of ages and we wish to know what percentile a 26 year-old would be in. Using `MODELPERCENTILE(26, {Age})` will allow us to calculate that.

{% embed url="<https://datawrapper.dwcdn.net/6FTcp/4>" %}

Now let's say that we wish to know what percentile each age in our dataset is. If we input `MODELPERCENTILE({Age}, {Age})`, we will get a corresponding percentile value for each age.

{% embed url="<https://datawrapper.dwcdn.net/qfLGq/2>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cascade.io/cascade/functions-and-expressions/functions/math/percentileofvalue.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
