the formulas are in the named ranges, basicaly i made it dynamicaly create the range based on what was selected in the Filter cell, i used a few formulas in combination
to populate that range i used 2 helper columns, one to find if the item was in the filter Col A:
and one to give it a unique value counting only filtered results Col B:
then in Col F i just listed the numbers from 1 to the highest possible number
in Col G i used a vlookup:
then in H1 i put a count, just to know where the last used cell is:
=1048576-COUNTBLANK(G:G)
for the Named Range i used:
Bookmarks