How to Average Values Between Dates Ignoring Zeros in WPS Spreadsheet
Question details
The user needs to calculate the average of values that fall between two specific dates and match a location, while strictly excluding zero values from the calculation.

- Product
- WPS Spreadsheet / Microsoft Excel
- Device & OS
- not provided
- Scenario
- Analyzing data where specific conditional averages are required based on date constraints, locations, and non-zero values, but formula attempts are returning unexpected results.
- Observed behavior
- Using an incorrectly structured DAVERAGE database or criteria range causes unexpected data outputs or incorrect averages.
Ensure your data table has clear, unique header names for each column, and verify that your date entries are consistently formatted and recognized by the spreadsheet program as actual dates, not text.
Use the AVERAGEIFS Function (Recommended)
AVERAGEIFS is the most efficient method for calculating averages based on multiple criteria, such as date ranges and non-zero conditions, because it does not require an external criteria table.
The AVERAGEIFS function evaluates multiple conditions dynamically in a single cell. This makes it significantly easier to manage than DAVERAGE when filtering out zeroes and restricting data to date ranges.
Locate the column containing the values you want to average, the column containing dates, and the column for the specific location.
Click on the empty cell where you want the calculated average to appear.
Type the formula using your specific cell references. A standard structure looks like this: =AVERAGEIFS(Value_Range, Date_Range, ">=Start_Date", Date_Range, "<=End_Date", Location_Range, "Specific_Location", Value_Range, "<>0").
Press Enter to compute the average. Ensure you use quotes around logical operators and dates within the formula.

Properly Structure the DAVERAGE Function
If you prefer using database functions, DAVERAGE can achieve this result. However, you must carefully set up an exact criteria range that identically matches your database headers.
Master Complex Formulas with WPS Spreadsheet
WPS Spreadsheet fully supports advanced functions like AVERAGEIFS and DAVERAGE, making it incredibly easy to filter, analyze, and compute data between specific dates. The software features built-in formula guidance to prevent syntax errors.
- 1. Open your dataset: Launch WPS Spreadsheet and open your .xlsx or .csv data file.
- 2. Access the Formulas tab: Select an empty cell, navigate to the Formulas tab on the top ribbon, and click 'Insert Function'.
- 3. Search for AVERAGEIFS: Search for AVERAGEIFS in the dialog box and click OK. The built-in wizard will open.
- 4. Fill in the arguments: Use the wizard prompts to select your average range, criteria ranges, and conditions (like "<>0"). Click OK to execute.

Frequently Asked Questions
Why does my AVERAGEIFS formula return a #DIV/0! error?
This error occurs if no cells in your data meet all of your specified criteria. Double-check that your date range correctly overlaps with your dataset and that the "<>0" condition actually leaves valid numbers to calculate.
Can I use cell references instead of hardcoding dates in the AVERAGEIFS formula?
Yes. Instead of typing ">=2023-01-01", you can use the ampersand operator to link to a cell. For example, use ">="&A1, where cell A1 contains your target start date.
Why is my DAVERAGE formula returning unexpected or incorrect results?
DAVERAGE relies on perfectly matching column headers between your main data and your criteria table. Check for hidden spaces in your database headers, ensure the criteria range is mapped accurately in the formula, and verify there are no empty rows in the criteria block.




