With adavnced filter, how do I exclude a value?

nmss18

Active Member
Joined
Jun 28, 2011
Messages
312
Hello,
I am trying to use the advanced criter filter to filter OUT a value. For example. In the table below, how do I display everything but beverages. I am using the <> to filter this out but it is not working.
Any assistance would be grateful.
Thanks,
nmss18

<form id="aspnetForm" method="post" name="aspnetForm" action="http://office.microsoft.com/en-us/excel-help/filter-by-using-advanced-criteria-HP010073942.aspx">Type</form>SalespersonSales
<>Beverages
<form id="aspnetForm" method="post" name="aspnetForm" action="http://office.microsoft.com/en-us/excel-help/filter-by-using-advanced-criteria-HP010073942.aspx">Type</form>SalespersonSales
BeveragesSuyama$5,122
MeatDavolio$450
produceBuchanan$6,328
ProduceDavolio$6,544

<tbody>
</tbody><colgroup><col span="3"></colgroup>
 
I think I have done this, but please say if there is a better solution

Code:
=IF(AND(COUNTBLANK($BG$6:$BG$12)>0,ISBLANK(BG21)),FALSE,ISNA(MATCH(BG21,$BG$6:$BG$12,0)))

Thanks

Can be shorter...

=AND(BG21<>"",ISNA(MATCH(BG21,$BG$6:$BG$12,0)))
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I think I have done this, but please say if there is a better solution

Code:
=IF(AND(COUNTBLANK($BG$6:$BG$12)>0,ISBLANK(BG21)),FALSE,ISNA(MATCH(BG21,$BG$6:$BG$12,0)))

Thanks

Hi again

OK, little more complex now. It is working but I'm thinking there's a better way.

Now I've included a partial non match

Code:
=IF(AND(COUNTBLANK(BG$6:BG$12)>0,ISBLANK(BG21)),FALSE,IF(ISNA(LOOKUP(1E+100,SEARCH($BG$6:$BG$12,BG21),ROW($BG$6:$BG$12))),ISNA(MATCH(BG21,BG$6:BG$12,0)),FALSE))

Can this be done more efficient

Thanks
 
Upvote 0
Hi again

OK, little more complex now. It is working but I'm thinking there's a better way.

Now I've included a partial non match

Rich (BB code):
=IF(AND(COUNTBLANK(BG$6:BG$12)>0,ISBLANK(BG21)),
FALSE,IF(ISNA(LOOKUP(1E+100,SEARCH($BG$6:$BG$12,BG21),ROW($BG$6:$BG$12))),
ISNA(MATCH(BG21,BG$6:BG$12,0)),FALSE))

Can this be done more efficient

Thanks

Assuming that we want to exclude blanks, partial and full matches...
Rich (BB code):
=AND(
  $BG1<>"",
  ISNA(LOOKUP(9.99E+307,SEARCH($BG$6:$BG$12,$BG21)),
  ISNA(MATCH($BG21,BG$6:BG$12,0)))

In fact, the following might suffice:
Rich (BB code):
=AND(
  $BG1<>"",
  ISNA(LOOKUP(9.99E+307,SEARCH($BG$6:$BG$12,$BG21)))

Note. No need introducing a new constant like 1E+100 next to Excel's 9.99999999999999E+307, sometimes abbreviated to 9.99E+307 (see http://www.mrexcel.com/forum/excel-questions/102091-9-9999999-a.html).
 
Upvote 0

Forum statistics

Threads
1,215,444
Messages
6,124,891
Members
449,194
Latest member
JayEggleton

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