Others

Calculate an Average Without Zero Values in Microsoft Access

Khadija KhanKhadija Khan Nov 22, 2026 869 views

Question details

Calculate the average of a numeric field in Microsoft Access without including zero values.

Calculate an Average Without Zero Values in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
A user wants an aggregate query to average only nonzero values in a table.
Observed behavior
A normal average includes zero values, which can lower the result.
Before you start

Identify the table and numeric field you want to average, and replace the example names in the SQL with your own. Decide whether negative values should be included; the examples below include all nonzero values.

Solution 1Recommended

Filter Out Zeros Before Calculating the Average

Use an aggregate query when you only need the average of nonzero records.

1
Open SQL View

In Access, select Create > Query Design, then switch to SQL View.

2
Enter the query

Enter: SELECT Avg([ValueField]) AS AverageValue FROM [YourTable] WHERE [ValueField] <> 0; Replace [ValueField] and [YourTable] with your field and table names.

3
Run the query

Select Run to display the average. Access excludes zero and Null values from this calculation.

Filter Out Zeros Before Calculating the Average
When there are no nonzero values: The aggregate returns Null if no values qualify. It includes negative values because the condition excludes only zero.
Free Microsoft Office alternative

Calculate Nonzero Averages in WPS Spreadsheets

WPS Office is a free, lightweight Office alternative with a familiar interface. For spreadsheet data, WPS Spreadsheets can calculate a nonzero average with AVERAGEIF. It does not modify Access queries, but it can help you work with exported spreadsheet data.

Use AVERAGEIF to average spreadsheet values that are not zero.Open and edit Microsoft Excel XLSX files for easier migration.Work with a familiar spreadsheet interface in a lightweight office suite.Use core office tools for free.
microsoft office alternative - wps office

Frequently Asked Questions

Does the nonzero average include negative numbers?

Yes. The condition [ValueField] <> 0 includes both negative and positive values. Use [ValueField] > 0 in the query criteria if you want only positive values.

What happens if every value is zero or Null?

The average returns Null because there are no qualifying values. To display 0 instead, use Nz around the aggregate expression, such as Nz(Avg(IIf([ValueField] <> 0, [ValueField], Null)), 0).

Can I exclude zeros from the average but keep those records in other totals?

Yes. Add Avg(IIf([ValueField] <> 0, [ValueField], Null)) to the query instead of filtering zeros in the WHERE clause. Other aggregates can then still use the zero-value records.

How can I calculate the same average in a spreadsheet?

In WPS Spreadsheets or Excel, enter =AVERAGEIF(A2:A100,"<>0") and adjust the range to match your data. The formula averages nonzero numeric values.