# MEDIAN

The **MEDIAN** function returns the middle value in a list of numbers. It represents the central value when the numbers are arranged in ascending order.&#x20;

For an even number of values, MEDIAN returns the average of the two middle values.

### Syntax

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

### Arguments

The MEDIAN function syntax has the following arguments:

* number1, number2, ... - The numbers or range of values for which you want to find the median. Required.

### Example

<pre class="language-javascript"><code class="lang-javascript"><strong>MEDIAN(10,30,50,40,20)
</strong>// returns 30
<strong>MEDIAN(10,30,50,60,40,20)
</strong>// returns 35
</code></pre>

You can use the **MEDIAN** function to find the middle value of a dataset in metrics like salary, revenue, sales, or scores, especially when you want to reduce the impact of extreme values.

<figure><img src="/files/5lM1XyGnGvV3VkcIrznL" alt=""><figcaption><p>MEDIAN function</p></figcaption></figure>

{% hint style="info" %}
We can also use the [**SELECT**](/planning-sheets/formula-syntax/measure-column-selection-functions/select.md) function to select a range of columns from 1 to 4 for the 'Revenue' measure (2022 Revenue - 2025 Revenue).
{% endhint %}

### Excel Equivalent

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


---

# 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.fabricplan.com/planning-sheets/formula-syntax/statistical-functions/median.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.
