title: EXCEL Count number of weeks in month based on date
body: <p>I am trying to look up a value in a matrix based on a given date. The matrix has the first day of the week along the vertical axis, and the first day of the month along the horizontal axis. </p>
  
  <p>For a given day, e.g. 31/08/15 I would like to match the exact date to the vertical axis of the matrix (i.e. 31/08/15), and the month to the horizontal axis (1/08/15). </p>
  
  <p>So in the example below, an input of 31/08/15 should provide an output of 3. </p>
  
  <pre><code>    01/06/2015  01/07/2015  01/08/2015  01/09/2015
  03/08/2015  1   0   0   0
  10/08/2015  0   2   0   0
  17/08/2015  0   0   3   0
  24/08/2015  0   0   0   4
  31/08/2015  0   0   3   0
  </code></pre>
  
  <p>I am trying and failing with index and match formulae. 
  I have tried the following:
  =index(area where to look, match(31/08/15,first column,0),match(and(month(31/08/15),year(31/08/15)),(and(month(first row),year(first row)),0)</p>
  
  <p>Hope this is clear, thanks!</p>