How to Calculate Separate Averages for Positive and Negative Values in Excel
Question details
The user wants to calculate separate average values for positive numbers and negative numbers within a single data range.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Performing data analysis that requires distinct average metrics for gains (positive values) and losses (negative values).
- Observed behavior
- Needs a reliable formula to selectively average values based on whether they are greater than, equal to, or less than zero.
Ensure your data range contains actual numeric values and not text formatted to look like numbers. If you are calculating percentages, confirm the cells are properly formatted as percentage values.
Use the AVERAGEIF Function
The AVERAGEIF function is the most universally compatible way to average numbers based on a condition, working seamlessly in almost all versions of Excel and WPS Office.
AVERAGEIF allows you to specify a range and a condition. It will automatically scan the range, pick out only the numbers that meet your criteria, and return their average.
Click on the empty cell where you want the average of the positive numbers to appear.
Type =AVERAGEIF(C2:C13, ">=0") into the formula bar, replacing C2:C13 with your actual data range. To strictly exclude zeros from the average, use ">0" instead.
Select another empty cell for your negative average and type =AVERAGEIF(C2:C13, "<0"), then press Enter.

Use AVERAGE and FILTER Functions
For newer versions of Excel supporting dynamic arrays, nesting the FILTER function inside AVERAGE provides a modern and flexible approach.
Use WPS Spreadsheet to Calculate Conditional Averages
WPS Office provides a powerful, free Spreadsheet tool that fully supports formulas like AVERAGEIF, enabling you to calculate complex metrics effortlessly while maintaining complete compatibility with Microsoft Excel files.
- 1. Open your data: Launch WPS Spreadsheet and open your existing workbook.
- 2. Select a blank cell: Click on the cell where you want to display the calculated average.
- 3. Enter the formula: Type =AVERAGEIF(A1:A10, ">0") to average positive numbers, modifying the range to match your dataset.
- 4. Calculate: Press Enter to execute the formula and instantly view the result.

Frequently Asked Questions
How can I calculate the average excluding zeros entirely?
To calculate an average that strictly ignores zero values, use the criteria ">0" for positive numbers instead of ">=0". If you want to average all non-zero numbers regardless of their sign, you can use the formula =AVERAGEIF(A1:A10, "<>0").
Why does my AVERAGEIF formula return a #DIV/0! error?
This error occurs if there are no numbers in the selected range that meet your specific criteria. For example, if you ask for the average of negative numbers (using "<0") but the range contains only positive values, the function cannot divide by zero and returns this error.
Can I calculate conditional averages across multiple columns or rows?
Yes, functions like AVERAGEIF can evaluate an entire block or matrix of cells (e.g., A1:D10). Simply input the multi-column or multi-row range into the formula: =AVERAGEIF(A1:D10, ">0").




