Q:

How to filter Excel spreadsheet by pattern?

I am looking to filter a column in an Excel spreadsheet based on a pattern as follows:
Cell value should end in "-####.html" (where #### is a 4 digit number).

This should match -1234.html but should not match -test.html.
The best solution I have been able to find so far is the "Custom AutoFilter" option where I can set the filter criteria to end with -????.html but this does not explicitly include only numbers:

Can anyone suggest a simple way to do this that does not involve complex VB macros?

A:

Assuming your data has row 1 as a header row so that actual data starts on row 2, and that the column containing the data is column A, you can use this formula in an unused column starting in row 2 and copy down:
=AND(MID(A2,LEN(A2)-9,1)="-",ISNUMBER(--MID(A2,LEN(A2)-8,4)),LOWER(RIGHT(A2,5))=".html",LEN(A2)>10)

Then filter on the new column for TRUE

