Counting Records Meeting a Complex Criteria

Counting Records Meeting a Complex Criteria

Let's say we have a database like this


How can I code a general function to count the number of widgets meeting any criteria (color, size, gloss, material)?

Test case 1: Color = yellow and Gloss = H
Test case 2: Size = L or S and Material = glass