The proper way to filter values not equal to zero in #Excel

I didn’t think of blogging about this topic before. I thought that it is so straight-forward. Nevertheless, there is another way of doing so which is even more straight-forward BUT may give you unexpected results later on. And to my surprise, that is the way most people (I encountered) do. Maybe it’s worth blogging about it.😁

You may download a sample file to follow along.

Situation

It is not uncommon to filter out all values that are not equal to zero. Let’s say we want to filter all records with Unit Sold not equal to zero, it is very common for us to simply uncheck 0 from the list of values. I did that (long before) too. 😅

By unchecking “0” from the list, we thought we have told Excel to keep all values but 0. However, Excel interprets it differently. Let’s see by hovering on the filter icon for unit sold:

Excel keeps the records that is equal to 100 or 19 or 24 or 31 or 42…… etc.

What??? 🤔🤔

Apparently, Excel takes it as Text filter and it keeps all current values but 0. To be more precise, It keeps the records that is equal to 100 or 19 or 24 or 31 or 42…… etc.

The Problem

What’s the problem? We still have a list of values that we want. You are right. It does not really matter if we want to just have a quick look at the data. Nevertheless, if we revise the data, and then Reapply the filter set, the problem arises.

Let’s say, we have revised two values from 24 to 0 in D4, and from 72 to 70 in D6, as shown below:

The highlighted values got revised.

Then we Reapply the filter as we want to focus on values that are not equal to 0. We expect that row 4 will be filtered out while row 6 will stay, right? However it is not the case!

Both rows are filtered out after we reapply the filter.

Ooops… Row 6 is filtered out after we Reapply the filter.

Why?

It is because the filter that was set up is to keep the records that is equal to 100 or 19 or 24 or 31 or 42…… etc., which a value of 70 was not included.

The value 70 is not included in the filter. That’s why!

Got it. Now we know the problem, so what’s the solution?

Using Number Filter

Instead of unchecking 0 from the filter menu, we should apply Number Filters.

(Note: when the column of data is numeric, we will see “Number Filters”; when the column of data is text, we will see “Text Filters”)

Pick an option to filter values that meet your criteria

There are many options for Number Filters, which I believe are self-explanatory. In our example, we want to focus on values that are not equal to zero, so we pick “Does Not Equal…” and input the following on the Custom AutoFilter dialog box:

Let’s check the filter criteria again:

The filter is now set to filter number does not equal “0”

It looks good. You know what I am going to do? Test the result:

Yeah! It works.

Bingo! Reapply filter returns expected result.

As simple as this. 😉

Advertisement

About MF

An Excel nerd who just transition into a role related to data analytics at current company......😊 Recently in love with Power Query and Power BI.😍 Keep learning new Excel and Power BI stuffs and be amazed by all the new discoveries.
This entry was posted in Excel Tips and tagged , . Bookmark the permalink.

Comments, suggestions, corrections are welcome.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.