Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. 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

by Allen Wyatt
(last updated September 12, 2015)

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, and 2013. 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

Entering Formulas in Excel

The way you signify that you are entering a formula is to start a cell entry with an equal sign. Here is the reason why Excel ...

Discover More

Extracting Street Numbers from an Address

Want to know how to move pieces of information contained in one cell into individual cells? This option exists in using ...

Discover More

Making a Cell's Contents Bold within a Macro

When your macro is processing information in a worksheet, do you need to periodically make the contents of a cell bold? You ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Maintaining Formatting when Refreshing PivotTables

When you refresh the data in a PivotTable, Excel can play havoc with whatever formatting you applied. Here's how to protect ...

Discover More

Error in Linked PivotTable Value

Excel allows you to link to values in other workbooks, even if those values are in PivotTables. However, Excel may display an ...

Discover More

Weighted Averages in a PivotTable

PivotTables are used to boil down huge data sets into something you can more easily understand. They are very good simple ...

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}] 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 8 - 2?

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.