Exclude Zeros from the Minimum in an Excel PivotTable
Question details
Calculate the minimum value in an Excel PivotTable without counting zero values.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants to summarize numeric source data in a PivotTable and find the minimum nonzero value.
- Observed behavior
- The desired PivotTable minimum excludes zero values while retaining other numeric values.
Identify the numeric source column used for the minimum and check that its values are stored as numbers. The following method requires an Excel version with Power Query.
Create a Zero-Free Value Column with Power Query
Use this method to keep the original values while creating a column for the PivotTable minimum that treats zeros as null.
Select a cell in the source data, then choose Data > From Table/Range. Confirm the table range and headers if prompted.
In Power Query, select Add Column > Custom Column. Name it Nonzero Amount and enter `if [Amount] = 0 then null else [Amount]`, replacing Amount with your source column name.
Select the new column, choose an appropriate numeric type from Transform > Data Type, then select Home > Close & Load to load the query results into Excel.
Select a cell in the loaded table and choose Insert > PivotTable. Add your grouping fields to Rows or Columns, then drag Nonzero Amount to Values.
Open the Nonzero Amount field's menu in the Values area, choose Value Field Settings, select Min, and click OK.

Work with Spreadsheet Data in WPS Office
WPS Office is a free, lightweight Office alternative with a familiar spreadsheet interface. Open compatible Excel workbooks and continue working with your data as you move between applications.

Frequently Asked Questions
Will negative numbers still be included in the minimum?
Yes. The custom column replaces only zeros with null, so negative numbers remain eligible and may be the minimum.
What happens if a group contains only zeros?
The custom column contains no numeric values for that group, so it has no nonzero minimum. Check the source data rather than interpreting a displayed zero as a valid minimum.
Does hiding zeros in Excel exclude them from the calculation?
No. Display settings or number formats can hide zeros without removing them from the PivotTable calculation. Convert them to null in the query or otherwise exclude them from the data being summarized.
How do I update the minimum when source values change?
After editing the original source table, select Data > Refresh All to refresh the Power Query output and the PivotTable.




