Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Suppressing Zero Values in PivotTables.

Suppressing Zero Values in PivotTables

Written by Allen Wyatt (last updated September 14, 2020)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


7

Many people use the PivotTable feature of Excel to help analyze their data. One such person is Chris, who explained how he has approximately 40,000 rows of data which boil down to about 8,200 rows in a PivotTable. The problem is that only about 230 of those rows have non-zero values in them. Chris was looking for a way to suppress the PivotTable rows that contain zero balances.

There are various ways that a solution can be approached. For instance, you could work with the original data and delete zero-balance rows before creating the PivotTable. If that is not possible, you could sort your data so that all the zero values are at the end of the data. Then, create your PivotTable so it only reflects the non-zero rows.

You can also use a filter on the data, before creating the PivotTable, that would show only rows that are not equal to zero. In other words, create a PivotTable using just the filtered data.

Another option is to use a filter after the PivotTable is created. All you need to do is select the column to the immediate right of the PivotTable and then create the filter. Excel is smart enough to know that the filter should not apply to the blank column, but instead does its work on the rows that make up the PivotTable.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10259) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Suppressing Zero Values in PivotTables.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Cleaning Up a Document that Mixes Styles with Direct Formatting

Need to get rid of direct, explicit formatting applied to a document? Here's an easy way to do it using familiar Word tools.

Discover More

Copying a Hyperlink to Lots of Worksheets

Copying information from one place to another in a worksheet is easy. Copying hyperlinks may not seem that easy, but you ...

Discover More

Determining the Upper Bounds of an Array

When working with variables in a macro, you may need to know the upper boundary dimension for an array. This can be ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Expanding PivotTable Rows to Sheets

PivotTables are a great way to work with large quantities of data in an intelligent manner. Sometimes, however, you just ...

Discover More

Counting Ports of Call with a PivotTable

A PivotTable is a great way to aggregate and analyze data. Sometimes, though, it can be difficult to figure out how to ...

Discover More

Displaying a PivotTable's Name in the PivotTable

When you create a PivotTable, it can have a name. You may want this name to appear within the PivotTable itself. There is ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is six minus 4?

2016-10-31 16:08:45

Russ S.

There are ways to format the 0 so that you do not see it in excel, it's already been mentioned. However sometimes you want to copy and paste the report or print it. The formatting doesn't seem to take care of that and will still show "0" or "0.00".

One workaround I discovered was to use a calculated field in the pivot table ( Won't work if you do add the pivot to the data model ) and have the calculated field produce an "error" on your 0 values using divide by zero.

For example say you are doing a pivot and trying to get Sales from Column1 but omit "0" values:

=( SALES / SALES ) - 1 + SALES

What this does is take that value when calculating the pivot:

Since 0/0 = DIV/0 error it errors out and since you checked next to "For Error Values Show:" and left the field bank, it will give you a blank result.

This should leave your other values alone, for example if you had "2" in Sales column:

( 2 / 2 ) - 1 + 2 = 2


2015-09-15 08:06:20

Khushnood Viccaji

@Ed, what you say is partly true.

To work around this issue, you need check an option in the field settings to "Include new items in manual filter".

Unfortunately, this option is unchecked by default for all 'non-value' Pivot Table fields, where you might want to apply a filter.

Of course, a small piece of VBA code can fix this problem :)


2015-09-14 14:03:05

Ed

Be careful when using the filter to exclude zeros!

When the data change, with this method the filter will only show values equal to those that had been checked in the filter prior to the data-refresh.
So for example, if the original data did not have anything equal to three, then the filter-refresh will not bring any "3" values into the new table.

This applies to both pivot-table filters and to regular data-table filters (inc. quick-filters). In tables' filters, it is better to exclude by using the "Number Filters" selection from the filter button's pull-down menu, then select "Does Not Equal"....

Pivot tables don't seem to have that flexibility. If you refresh the table with new data you must recreate the excluding filter; open the filter, re-check "(All)", then de-select the value you want excluded.

Full disclosure: I don't use pivot-tables much, so I could be wrong, but this is what I noticed when I tried this. Perhaps a pivot-table maven could confirm or correct ?



2015-09-14 10:56:02

Dave Bonin

I used to deal with this issue in the old Fortran days when we'd print reams of paper with only a few non-zero values hidden among acres of zeros.

I eventually learned to use formatting to alter values of zero to be a single
decimal point. Users could see there was a numeric value (as opposed to a blank), but the zeros no longer obscured the non-zero numbers.

You can do the same with Excel formats, eg: '0.00;-0.00;"."_0_0;@'


2015-09-13 05:14:28

Khushnood Viccaji

@Carlos, I too wondered about how this particular option would work.
I may be wrong it, but about it, but I think what was meant was:
"Identify non-zero records in the source data (perhaps by setting up a helper column). Then use the helper column in the PivotTable Filter area to display only those records."

My comment above, takes a similar approach, but without having to add a helper column in the source data.


2015-09-12 17:59:00

Carlos M.

"You can also use a filter on the data, before creating the PivotTable, that would show only rows that are not equal to zero. In other words, create a PivotTable using just the filtered data."

Could you please explain a little more? As far as I know, when you select the pivot table source data, besides filtered data you must include titles too, and this selection includes no filtered records in the source range. I tried selecting only visible cells before building Pivot Table but no success.

Thank you,

Carlos


2015-09-12 08:17:06

Khushnood Viccaji

Yet another way would be to add a duplicate of the Values field in the PivotTable's Filter area (at the top left), and in that field, uncheck the '0'.
This will leave only the records with non-zero values displayed in the PivotTable


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.