Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Using GEOMEAN with a Large List.

# Using GEOMEAN with a Large List

by Allen Wyatt
(last updated November 23, 2019)

Ken wrote about a problem he was having with the GEOMEAN function. When he attempts to use the function on a large number of values (3,500 rows of data), he gets a #NUM error value returned.

The GEOMEAN function is used to return the geometric mean of a series of values. The GEOMEAN of n numbers is the n-th root of the product of the numbers. For example, if there are four values in a series (A through D), then the product of those numbers is A * B * C * D, and the GEOMEAN is the fourth root of that product.

The #NUM error would be returned if any of three conditions were met: any of the values was equal to zero, any of the values was negative, or the limits of Excel were exceeded. It is likely that it is this last condition that Ken is running into, particularly if any of his 3,500 values are large.

Since GEOMEAN finds the product of the 3,500 numbers (multiplies them all by each other) and then takes the nth root, the product may easily be too large for Excel. The largest positive number in Excel is 9.99999999999999 * 10^307 (in scientific notation this is written as 9.99999999999999E+307). If the product gets larger than this number, you will get a #NUM error for the function.

The solution is to use logs to do the calculation. This is easiest to understand when you look at a transformation of the GEOMEAN function:

```GEOMEAN = (X1*X2*X3*...*Xn)^ (1/n)
ln(GEOMEAN) = ln((X1*X2*X3*...*Xn)^ (1/n))
ln(GEOMEAN) = (1/n) * ln(X1*X2*X3*...*Xn)
ln(GEOMEAN) = (1/n) * (ln(X1)+ln(X2)+ln(X3)+...+ln(Xn))
ln(GEOMEAN) = average(ln(X1)+ln(X2)+ln(X3)+...+ln(Xn))
GEOMEAN = exp(average(ln(X1)+ln(X2)+ln(X3)+...+ln(Xn)))
```

If you follow through the above, you see that GEOMEAN is equivalent to the exponent of the average of the logs of the values. You can calculate the desired result by using the following array formula instead of the GEOMEAN function:

```=EXP(AVERAGE(LN(A1:A3500)))
```

This assumes that the desired values are in the range A1:A3500. Since it is an array formula, you must enter it into a cell by using Ctrl+Shift+Enter.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9328) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Using GEOMEAN with a Large List.

##### Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

##### MORE FROM ALLEN

Formatting Datasheet Numbers

Controlling the appearance of numbers in a datasheet.

Discover More

Inserting and Deleting Footnotes

Footnotes are essential in some types of writing. When you need to add footnotes to your documents, you'll appreciate the ...

Discover More

Finding the Address of the Lowest Value in a Range

Uncovering the lowest value in a range is relatively easy; you can just use the MIN worksheet function. Discovering the ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

##### More ExcelTips (ribbon)

Counting Displayed Cells

When you filter data, Excel displays only a portion of what is really in a worksheet. If you want to count the number of ...

Discover More

Making VLOOKUP Case Sensitive

The VLOOKUP function, like other lookup functions in Excel, is not case sensitive. In other words, it doesn't matter ...

Discover More

Returning Blanks or Asterisks from a Lookup

Want to return more than a value when doing a lookup? Here are a couple of ways to do it by adding an IF clause to your ...

Discover More
##### Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. Youâ€™ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is three minus 0?

2016-06-13 15:31:35

Candan

I see now that I missed the sentence about it being an array formula. Feel free to disregard my earlier comment.

2016-01-06 17:55:52

Miguel R

Thanks! I used it for 3,700 rows of data!

2015-04-14 13:45:52

Randall

How or could you use the AVERAGEIFS function on multiple conditions instead of the AVERAGE ?

=EXP(AVERAGE(LN(A1:A3500)))

2014-05-23 17:15:38

Thank you so much for your instructions on this, they were very helpful.

Jim

##### This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.