title: Count if cells have the same month and year in their date
body: <p>I want to create a filter using a command like countif or similar with the following Criteria. I do not know if it possible and if it is this task is beyond my current knowledge of Excel; I have been unable to create a code that even makes sense with formulas such as Countif.</p>
  
  <p>This is an example of the table that is going to use the formula:</p>
  
  <p><a href="https://i.stack.imgur.com/P88k8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P88k8.jpg" alt="Table"></a></p>
  
  <p>In the cell belonging to Each Sample (e.i, 1) A value need to appear if there is a sample with the same code which date has similar month and year. later I will use this value to filter all Samples with similar Month and Year.</p>
  
  <p>I deeply appreciate any help on the matter.</p>