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 Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Calculate Trip Days by Month (Start, End, and Full Days) in Google Sheets

If you're managing business travel in Google Sheets, you may need to calculate how...

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

More like this

Calculate Trip Days by Month (Start, End, and Full Days) in Google Sheets

If you're managing business travel in Google Sheets, you may need to calculate how...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

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.