# VARS

The **VARS** function returns the sample variance of a dataset. It measures how widely values are spread from the mean when the data represents a sample of a larger population. The calculation uses (n − 1) in the denominator to provide an unbiased estimate.

### Syntax

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

### Arguments

The **VARS** function syntax has the following arguments:

* number1, number2, ... - The numeric values for which you want to calculate the sample variance. Required.

### Example

<pre class="language-javascript"><code class="lang-javascript"><strong>VARS(10, 20, 30)
</strong>// Returns 100
<strong>VARS(10, 20, 30, 40, 50)
</strong>// Returns 250
</code></pre>

You can use the **VARS** function to analyze how widely values are spread from the mean by calculating the sample variance for metrics such as sales, revenue, or performance scores.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FMj4UJ0WZo8bT1uStXPgq%2F2026-02-17_14h18_50.png?alt=media&#x26;token=cc02cb67-82c4-4011-bf4c-6049d9e26c78" alt=""><figcaption><p>VARS function</p></figcaption></figure>

{% hint style="info" %}
We used 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

[VARS](https://support.microsoft.com/en-us/office/var-s-function-913633de-136b-449d-813e-65a00b2b990b)

### FAQs

**Q1. How is VARS calculated?**

VARS (Sample Variance) is calculated by taking the sum of squared deviations from the mean and dividing it by (n − 1).

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FQ0dUvMmpGm5UgAxTQ3Y0%2F2026-02-17_14h21_59.png?alt=media&#x26;token=50e3cd85-d2f3-4817-98eb-c2e917079a13" alt="" width="194"><figcaption></figcaption></figure>

Where:

* x = each value in the dataset
* <img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2Fslitpr0n5IIdqR8vSl7J%2Fimage.png?alt=media&#x26;token=4d5395e4-8978-4933-b791-684a3e9cd48a" alt="" data-size="line"> = mean of the values
* n = number of values

It measures how widely the values are spread from the mean by calculating the sample variance, which represents the average squared deviation from the mean.
