How to Calculate Average if Greater Than Zero in Google Sheets
To calculate the average of numbers greater than zero in Google Sheets, you can use the AVERAGEIF function. This function calculates the average of a range of cells based on specific criteria. In this case, the criteria will be ">0" to include only numbers greater than zero.
Here's how you can use the AVERAGEIF function to calculate the average of numbers greater than zero:
- Open your Google Sheets document containing the data you want to calculate the average for.
- Click on an empty cell where you want to display the average.
- Type the following formula, replacing "range" with the range of cells containing the numbers you want to average:
=AVERAGEIF(range,">0")
For example, if you want to calculate the average of numbers greater than zero in cells A1:A10, you would use the following formula:
=AVERAGEIF(A1:A10,">0")
- Press Enter to apply the formula. The average of the numbers greater than zero in the specified range will be displayed in the selected cell.
Example
Let's say you have the following data in cells A1:A6:
5
-3
0
8
-1
4
To calculate the average of the numbers greater than zero, you would use the following formula in an empty cell:
=AVERAGEIF(A1:A6,">0")
After pressing Enter, the result would be 5.66666667, which is the average of the numbers 5, 8, and 4.