[excel] How to filter for multiple criteria in Excel?

I am trying to filter for multiple criteria, but I see that the "Filter" option only has 2 fields for "AND/OR" options. I have a column full of links. I want to extract all rows that contain these in it:

.pdf .doc .docx .xls .xlsx .rtf .txt .csv .pps

Is there a good way to do this?

This question is related to excel excel-2007

The answer is


Maybe not as elegant but another possibility would be to write a formula to do the check and fill it in an adjacent column. You could then filter on that column.

The following looks in cell b14 and would return true for all the file types you mention. This assumes that the file extension is by itself in the column. If it's not it would be a little more complicated but you could still do it this way.

=OR(B14=".pdf",B14=".doc",B14=".docx",B14=".xls",B14=".xlsx",B14=".rtf",B14=".txt",B14=".csv",B14=".pps")

Like I said, not as elegant as the advanced filters but options are always good.


You can pass an array as the first AutoFilter argument and use the xlFilterValues operator.

This will display PDF, DOC and DOCX filetypes.

Criteria1:=Array(".pdf", ".doc", ".docx"), Operator:=xlFilterValues