How to stop Excel Advanced Filter from recognising 0 as a criteria

shirleyj

New Member
Joined
Sep 14, 2011
Messages
37
Hi Mr Excel,

My criteria table is set up to work with some basic formulas. If the result of the formula is a blank or 0, Excel still treats this as a criteria. Unfortunately this means the advanced filter does not work as it should ... ie it returns 0 filtered rows. I am guessing that treating 0/blank as part of the criteria is a limitation of Excel's advanced filter? Just wondering if anyone knows any simple workarounds to this?

Many thanks,

Shirley
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
A formula that returns "" in the criteria range is treated like an empty cell (i.e. all rows meet that condition)
 
Upvote 0
Hi mikerickson,

I tried your suggested approach, but it is producing some unexpected results.

In my criteria table, I have two selection criteria – type and category. The idea is to have the criteria table used by the advanced filter on a sheet hidden from the user. When the selections are inputted on the selection sheet, I used the below formula to copy these to the criteria table on the hidden sheet:

=IF(type=””,”” ,type)

This formula works - if the user selects a type, it is populated on the criteria table and they don’t, it returns a blank.

The problem comes when I select a category, but try to leave the type blank. The result of the advanced filter is that it only returns the category rows that have something selected in the type – and misses out the category rows that have nothing selected in type (for example, it returns two rows, when I am expecting five).

Unless I am missing something, I think this is a shortcoming of Excel’s Advanced Filter … it only works well with databases that are fully populated, but not so great when there are some blank fields. Does anyone know if I am doing something wrong? I know the problem sounds very complicated, but I hope the solution is easy.

Best regards,

Shirley
 
Upvote 0
That does not work either. The only simple solution I could think of is to always ensure that the 'type' column is populated. Weirdly, if the 'type' column is populated and the 'category' is not, it works great, but if the category is populated and the type is not, it doesn't. I really believe this is just a shortcoming of the advanced filter. It could probably be worked around with some VBA code, but that's way too complicated for what I am trying to do.

Thanks for your responses ... much appreciated.
 
Upvote 0
How are these cells populated, VBA or formula?
If formulas what are they? Might there be a space instead of a zero-length string?
 
Upvote 0

Forum statistics

Threads
1,224,508
Messages
6,179,189
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top