AVERAGE Function: Advanced Tips and Tricks in Google Sheets

You can use the AVERAGE function to calculate the arithmetic mean, or simply the mean, in Google Sheets. The arithmetic mean is the average you’re likely familiar with: it’s the sum of a set of numbers divided by the count of those numbers.

In addition to the arithmetic mean, there are other types of mean calculations, each with its function in Google Sheets, such as TRIMMEAN, HARMEAN, and GEOMEAN.

AVERAGE Function: Syntax and Examples

To use the AVERAGE function, start by understanding its syntax and arguments.

Syntax:

AVERAGE(value1, [value2, …])

Arguments:

  • value1 – The first value or range to consider when calculating the mean.
  • value2, … – Optional. Additional values or ranges to include in the calculation.

The dimensions of value1 and value2 do not need to be the same. All values or ranges will be included together in the mean calculation.

Examples

Assume the values in A1:A5 are 5, 10, 10, 5, and 20. The following formula will return 10 as the average:

=AVERAGE(A1:A5)

This is equivalent to =SUM(A1:A5)/COUNT(A1:A5).

Here’s an example with multiple ranges:

=AVERAGE(A1:A100, B10:B25)

Note: The AVERAGE function in Google Sheets will ignore text and blank cells in the range.

Skipping Zeros in an AVERAGE Function Calculation

How do you exclude zeros from the average calculation?

The simplest way is to use the combination of AVERAGEIF and VSTACK functions.

To get the average of values in column A excluding zeros, use the AVERAGEIF formula:

=AVERAGEIF(A1:A, "<>0")

For multiple ranges, such as A1:A and C1:C, use the VSTACK function with AVERAGEIF:

=AVERAGEIF(VSTACK(A1:A, C1:C), "<>0")

Additional Tips

To find the average of values excluding zeros, you can also use a QUERY formula or a combination of FILTER and AVERAGE.

I’m including these methods as you might encounter them in a shared sheet.

The following QUERY formula returns the average of values in column A excluding zeros:

=QUERY({A1:A}, "SELECT AVG(Col1) WHERE Col1>0 LABEL AVG(Col1) ''")

The following combination of FILTER and AVERAGE functions achieves the same result:

=AVERAGE(FILTER(A1:A, A1:A>0))

Here, the FILTER function filters the range A1:A for values greater than 0, and the AVERAGE function returns the average of the filtered rows.

Resources

Here are some related resources and advanced tips and tricks for using the AVERAGE function in Google Sheets.

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.

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...

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...

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...

2 COMMENTS

  1. In Sheets, is there a way to avoid/ignore cells that contain the error “DIV/01!” when that cell needs to stay in line with other cells in the same row to calculate “Average”?

    Randomly, all cells could have numbers in them, they could be empty or they could contain the error “DIV/01!”

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.