# 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="/files/mpeiM7Ptjz8aC5U1OfJb" alt=""><figcaption><p>VARS 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).

<pre><code><strong>VARS(SELECT([Revenue], 1, 4))
</strong></code></pre>

{% 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="/files/yE1jJxteHjBciAQKAYj2" alt="" width="194"><figcaption></figcaption></figure>

Where:

* x = each value in the dataset
* <img src="/files/7kgTtFg5mZ5tcXpS74Op" 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.


---

# 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/vars.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.
