How to Use the VARA Function in Google Sheets

Published on

The VARA function in Google Sheets is one of the four functions for estimating variance based on a sample.

I will come to the name of the other three functions and how they differ from the VARA.

But before that, we must understand the terms ‘variance’ and ‘sample.’

The below example may help you understand the term sample, or we can say SAMPLE vs. POPULATION.

Population:

E.g.:- All students in my college.

Sample:

E.g.:- All students in the physics department in my college.

We use a sample when we find it tough to collect data from a whole population because of its size.

Regarding variance, it’s the measure of how far a set of numbers (values in a dataset) is dispersed from their mean value. Please see the example section to see the calculation/formula behind it.

The VARA function in Google Sheets has three siblings. They are VAR, VAR.S, and DVAR.

The below table explains how they differ.

Function NameCategoryRemarks
VARStatistics
VAR.SStatisticsIt replaces VAR. So use it instead.
DVARDatabaseTo use with structured data. It additionally supports conditions.
VARAStatisticsUnlike the other three, it evaluates the text and Boolean values. You can find more details under the “Formula Example” section below.

VARA Function Syntax and Arguments

Syntax:

VARA(value1, [value2, ...])

Arguments:

value1 – The first value or array of the sample.

value2 – The second value or array to include in the sample.

Value1 and value2 are required. Subsequent values are optional.

If you do not specify any value, the formula will return N/A. If there is only value1, then it will return DIV/0.

How many values or arrays can we specify within the VARA function in Google Sheets?

It is from 1 to 30, but Google Sheets supports an arbitrary number of arguments.

Formula Example

We can calculate the variance based on a sample manually as below.

Example:

Set of sample numbers – 5, 10, 15

Finding Mean = (5+10+15)/3 = 10

Finding the squared differences of the mean =(5-10)^2, (10-10)^2, (15-10)^2

Sum it =(5-10)^2+(10-10)^2+(15-10)^2 = 50

Average the sum of the squared differences of the mean by dividing it by sample size – 1

I.e., 50/2=25.

We can easily calculate the same using the VARA function as below in Google Sheets.

=vara(5,10,15)

If the above data points are in A1:A3, then you can use them directly within the formula.

=vara(A1:A3)

How do the Blank Cells, Boolean, and Text Strings affect the variance when using the VARA function?

It affects the variance calculation in the following ways.

  1. Blanks don’t make any changes in the result as the function ignores it.
  2. Text and Boolean FALSE values are converted to 0.
  3. Boolean TRUE values are converted to 1.

Specifying Criteria within the VARA Function in Google Sheets

We can use expressions within the VARA function to return the variance of a sample extracted from records based on given criteria, aka conditions.

Usually, we use the FILTER function within the VARA function for that. But we can also use the QUERY.

Here is how we can use FILTER/QUERY within VARA to return conditional variance based on a sample.

Sample Data:

Assume we have the height of men and women of a particular age group in our locality and want to return the conditional variance based on this data.

The condition to specify is column C = M (male).

Formula Using the VARA + FILTER Combination:

=vara(filter(B2:B18,C2:C18="M"))
VARA Function in Google Sheets - Filter Combo

Formula Using the VARA + QUERY Combination:

=vara(query(A1:C18,"Select B where C='M' label B''"))

When using QUERY, you must specify the label clause as above to remove the label of the height column.

Because VARA will consider labels as 0, and that may affect the result.

That’s all about the VARA statistical function in Google Sheets.

Thanks for the stay. Enjoy!

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Finding Most Frequent Text in Excel with Dynamic Array Formulas

Looking to identify the most frequently occurring text in Excel? You can do this...

Hierarchical Numbering Sequences in Excel

Creating hierarchical numbering sequences in an Excel spreadsheet can significantly improve the way you...

How to Easily Repeat a Sequence of Numbers in Excel

Excel offers multiple ways to accomplish tasks, and the simplicity of each approach depends...

Create a Sequence of Dates at Every Nth Row in Excel (Dynamic Array)

Would you like to create a sequence of dates in every nth row in...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.