title: Using IF in an ArrayFormula in Google Sheets to check values in each column and not just a specific column
body: <p>I am trying to use <code>ARRAYFORMULA()</code> in Google Sheets to automatically apply a formula whenever a new row is entered. What I want is to check if today falls between two dates (a start and end date) or not. My formula:</p>
  
  <pre><code>=arrayformula(if(isblank(A2:A), "", if(and(today() &gt;= B2, today() &lt;= D2), "On Leave", "Available")))
  </code></pre>
  
  <p>That formula keeps checking against B2 and D2 for all rows inserted, so I tried this:</p>
  
  <pre><code>=arrayformula(if(isblank(A2:A), "", if(and(today() &gt;= B2:B, today() &lt;= D2:D), "On Leave", "Available")))
  </code></pre>
  
  <p>This second formula checks against all the values in column B and column D for every row, as against checking the respective value in column B and column D for that particular row e.g. row 3: B3, D3; row 4: B4, D4 etc.</p>
  
  <p>Is there anyway I can get my desired behaviour? I've attached a screenshot of my sheet.</p>
  
  <p><a href="https://i.stack.imgur.com/7Y0PE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Y0PE.png" alt="Google Sheet Screenshot"></a></p>
  
  <p>With the correct formula, Bruce Lee would not be on leave.</p>