title: How can I SUMIF with horizontal and vertical criteria (including dates)?
body: <p>I'm trying to <code>SUMIF</code> data based on two criteria: </p>
  
  <ol>
  <li>The title of the column (horizontal)</li>
  <li>In between two dates (vertical)</li>
  </ol>
  
  <p>I have tried a number of functions to solve this problem but to no avail. </p>
  
  <p><a href="https://i.stack.imgur.com/fiD1U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fiD1U.png" alt="0"></a></p>
  
  <p>I have tried functions with Match, Index, and Filter, but I couldn't make the function work. </p>
  
  <p>As you can see in my code, I have found a workaround, but it is not ideal as it does not use the table header to identify the data values I'm looking for (see example function below for Product A). </p>
  
  <p><code>=SUMIFS(B:B,A:A,"&gt;="&amp;A$2,A:A,"&lt;="&amp;A$5)</code></p>
  
  <p>I'm hoping for a function that can dynamically grab the values I'm looking for, based on the table header and the dates. </p>
  
  <p>Thank you for any help you may provide.</p>