title: Google Sheets: IF and Date formula not working
body: <p>I'm calculating annual holiday accrual.</p>
  
  <p>All holiday resets at the start of the calendar year.</p>
  
  <p>If a staff member started after 01.01.2017 they will have a lower holiday entitlement for the year.</p>
  
  <p>I'm trying to create a formula which says:</p>
  
  <p>If this cell's date is after 01.01.2017 return that cells date. Otherwise, set it at 01.01.2017.</p>
  
  <p>(so basically, I don't care when they started if it was before 01 Jan 2017 because all my following calculations will be based off the first day of the year) </p>
  
  <p>Here it is: </p>
  
  <pre><code>=if(T21&lt;date(1,1,2017),T21,"01/01/2017")
  </code></pre>
  
  <p>No matter what is in the cell, it is returning 01/01/2017.If I change the &lt; to > it returns cell T21 in all cases.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks </p>