title: Excel SUMIF using text and date ranges defined by cell value
body: <h1>What I have:</h1>
  
  <ol>
  <li>I have two spreadsheets in a workbook titled "Ledger" and "Budget".</li>
  <li>"Budget" uses SUMIF on "Ledger" to find the total "Weekly rent".</li>
  </ol>
  
  <p><strong>"Ledger" spreadsheet:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/rdIYy.png" alt="&quot;Ledger&quot; spreadsheet"></p>
  
  <p><strong>"Budget" spreadsheet:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/7qKsa.png" alt="&quot;Budget&quot; spreadsheet"></p>
  
  <h1>What I need:</h1>
  
  <p>I need the SUMIF function to simultaneously work with a date range. e.g. In the "Budget" spreadsheet, the desired SUMIF value (Cell O8) should be constrained by "Week start" (Cell B8) and "Week end" (Cell C8). Right now, as depicted in the screenshots, the SUMIF does not apply the date range criteria.</p>
  
  <h1>My code:</h1>
  
  <p>For cell O8: </p>
  
  <pre><code>=SUMIF(Ledger!M:M, "Weekly rent", Ledger!P:P)
  </code></pre>
  
  <h1>My question:</h1>
  
  <p>How do I include the date criteria using "Week start" (Cell B8) and "Week end" (Cell C8)?</p>