Search code examples
excelvbasearchcriteriacountif

Multiple criteria search with IDs


I don't usually come to Stack Overflow empty handed (without having VBA code) but I honestly don't know how to get the following idea to work.

I'm trying to build a raw data search engine which would work by setting 3 criteria in a box/cells on the side of the spreadsheet. The raw data contains sets of IDs in column (A) with various lengths, the search should run once for every set of IDs and look up whether it can match CRITERIA 1 & CRITERIA 2 to column (B) and whether it can match CRITERIA 3 to column (C).

If all three criteria match for one set of IDs then search engine should return "MATCH" in column (D)

see excel example here

Note note that ultimately the macro should be able to run the search on around 50'000 rows of data and for up to 5 criteria!

How can I start, or what functions should I use?


Solution

  • I tried to recreate the same table than you. You can see that I don't need VBA for this. Use directly an IF with a combination of AND/OR, and autofill the column :)

    enter image description here