Function Problems

How to Calculate Separate Averages for Positive and Negative Values in Excel

Algirdas JasaitisAlgirdas Jasaitis Nov 10, 2026 869 views

Question details

The user wants to calculate separate average values for positive numbers and negative numbers within a single data range.

How to Calculate Separate Averages for Positive and Negative Values
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the target cell for positive averages

Click on the empty cell where you want the average of the positive numbers to appear.

2
Enter the positive criteria formula

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.

3
Calculate the negative average

Select another empty cell for your negative average and type =AVERAGEIF(C2:C13, "<0"), then press Enter.

Use the AVERAGEIF Function
Tip: You can also reference a cell containing your criteria instead of typing it into the formula directly. For example, =AVERAGEIF(C2:C13, E1) where E1 contains the text <0.
Free and Powerful Spreadsheet Software

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. 1. Open your data: Launch WPS Spreadsheet and open your existing workbook.
  2. 2. Select a blank cell: Click on the cell where you want to display the calculated average.
  3. 3. Enter the formula: Type =AVERAGEIF(A1:A10, ">0") to average positive numbers, modifying the range to match your dataset.
  4. 4. Calculate: Press Enter to execute the formula and instantly view the result.
Fully compatible with Microsoft Excel (.xlsx, .xls) formats and formulas.Supports advanced functions like AVERAGEIF and array formulas without extra setup.Free, lightweight, and fast to launch on Windows, Mac, and mobile devices.Clean, tabbed interface that feels familiar to Office users.
microsoft office alternative - wps office

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").