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.

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Compare Two Tables for Differences in Excel

To compare two tables with similar data for differences, you can use the XLOOKUP...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

More like this

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

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.