HomeGoogle DocsSpreadsheetHow to Use the VARA Function in Google Sheets

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.

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Running Total By Month in Excel

This tutorial demonstrates how to calculate the running total by month in a range...

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

More like this

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

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.