# 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="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FVwKHartxreNJ63nhDWPT%2F2026-02-13_17h06_25.png?alt=media&#x26;token=d4ed05dc-fe97-4eae-8dc4-ebabd0116407" alt=""><figcaption><p>MEDIAN function</p></figcaption></figure>

{% hint style="info" %}
We can also use the [**SELECT**](https://docs.inforiver.com/formula-syntax/measure-column-selection-functions/select) 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)
