I have 50-digit long binary IDs (whose numbers correspond to qualitative data of a two-consonant long string) that I want to filter based on partial matches to what I call filter IDs, which are also 50-digits long but in trinary. 0 = no, 1 = yes, 2 = do not evaluate. The idea is my custom STRINGMATCH function will output the number of matches between the data ID and filter ID. This number will be compared to the number of filters selected by the user. This method allows for unselected categories to be skipped in the evaluation, as well as the selection of data that matches all selected criteria, thus leaving untouched the data that meets only some of the selected criteria.
For example, let's look at just one:
- Data ID = 11000000000100001000000001000100000000000010000000
- Number of filters selected = 7 (not shown in picture)
- Filter ID = 12222222022122222222222221022202222222222212222222
- STRINGMATCH(Data ID, Filter ID) = 7
- Filter = TRUE
I can get this to work with one filter ID. But what if I want to run the same cell through arbitrarily many filter IDs, like say, a hundred? I mean, I could code a hundred IF-OR statements, but is there a way to more efficiently perform this task? Oh, if only Google Sheets had a FOR loop function...
Let me know if my question is too confusing or if there is no way to do this in Google Sheets. Thanks!