title: Google Sheets formula match multiple criteria
body: <p>I have a spreadsheet like the one shown in the image. What I would like to do is generate a formula that will count how many times <em>MALEs</em> from <em>NEW YORK</em> choose the <em>BLUE</em> color. In column D, the user can enter 1-3 different colors. Column B will be ignored in this case. Can anyone help me with the formula?</p>
  
  <p><img src="https://i.stack.imgur.com/vJ3Em.png" alt=""></p>