> For the complete documentation index, see [llms.txt](https://docs.fabricplan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fabricplan.com/planning-sheets/reference/formula-syntax/statistical-functions/calculate-measures-of-central-tendency.md).

# Calculate measures of central tendency

Plan provides functions to identify the central or most representative value in a dataset. Use the functions in this section to calculate statistical measures such as the median and mode, to summarize and analyze numerical data.

### MEDIAN

The *MEDIAN* function returns the middle value in a set of numbers arranged in ascending order. If the set contains an even number of values, the function returns the average of the two middle values.

#### Syntax

```
MEDIAN(number1, [number2], ...)
```

#### Arguments

* `number1`, `number2`, ...: The numbers or range of values used to calculate the median value.

#### Return value

Returns the median value of the specified set of numbers.

#### Examples

```
MEDIAN(10,30,50,40,20)
```

Returns the middle value from the specified set of numbers. In this example, the function returns `30`.

```
MEDIAN(10,30,50,60,40,20)
```

Returns the average of the two middle values from the specified set of numbers. In this example, the function returns `35`.

You can use the *MEDIAN* function to determine the middle value of a dataset, such as salaries, revenue, sales, or scores, especially when you want to reduce the impact of extreme values.<br>

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F9HvN0j37ti00PGjD5LuD%2Fimage.png?alt=media&amp;token=6dda971b-2975-42cc-a706-62661a279e20" alt=""><figcaption></figcaption></figure>

#### Excel Equivalent

[MEDIAN](https://support.microsoft.com/en-us/office/median-function-d0916313-4753-414c-8537-ce85bdd967d2)

### MODE

The *MODE* function returns the value that appears most frequently in a set of numbers. If multiple values have the same highest frequency, the function returns only one of those values.

#### Syntax

```
MODE(number1, [number2], ...)
```

#### Arguments

* `number1`, `number2`, ...: The numbers or range of values used to determine the most frequently occurring value.

#### Return value

Returns the most frequently occurring value from the specified set of numbers.

#### Examples

```
MODE(10, 20, 30, 20, 40)
```

Returns the most frequently occurring value from the specified set of numbers. In this example, the function returns `20`.

```
MODE(5, 8, 5, 10, 8, 5)
```

Returns the most frequently occurring value from the specified set of numbers. In this example, the function returns `5`.

You can use the *MODE* function to determine the most common value in a dataset, such as sales, scores, or costs.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2Feoq6iEemuf0jZItA1Xsd%2Fimage.png?alt=media&amp;token=2b304950-1a7c-4a3b-a107-f200543175d5" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}

#### Note

If no values are repeated, the *MODE* function returns an **`#ERR`** error. You can display a custom value instead of the **`#ERR`** error by using a conditional statement in the formula or by updating the setting under **Format** > **Appearance**.
{% endhint %}

#### Excel Equivalent

[MODE](https://support.microsoft.com/en-us/office/mode-function-e45192ce-9122-4980-82ed-4bdc34973120)

### MODESNGL

The *MODESNGL* function returns the single most frequently occurring value in a set of numbers. If multiple values have the same highest frequency, the function returns the first value that occurs among them.

#### Syntax

```
MODESNGL(number1, [number2], ...)
```

#### Arguments

* `number1`, `number2`, ...: The numbers or range of values used to determine the single most frequently occurring value.

#### Return value

Returns the single most frequently occurring value from the specified set of numbers.

#### Examples

```
MODESNGL(10, 20, 30, 20, 40)
```

Returns the single most frequently occurring value from the specified set of numbers. In this example, the function returns `20`.

```
MODESNGL(5, 8, 5, 10, 8, 5, 8)
```

Returns the first value among those with the highest frequency. In this example, the function returns `5`.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FcqgEExkGYoQb8PjiaJUW%2Fimage.png?alt=media&amp;token=ef2d67a9-3307-4609-b125-daf90b6686c1" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}

#### Note

If no values are repeated, the *MODESNGL* function returns an **`#ERR`** error. You can display a custom value instead of the **`#ERR`** error by using a conditional statement in the formula or by updating the setting under **Format** > **Appearance**.
{% endhint %}

#### Excel Equivalent

[MODE.SNGL](https://support.microsoft.com/en-us/office/mode-sngl-function-f1267c16-66c6-4386-959f-8fba5f8bb7f8)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.fabricplan.com/planning-sheets/reference/formula-syntax/statistical-functions/calculate-measures-of-central-tendency.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
