title: Google Spreadsheet calendar formula
body: <p>I'm trying to make a Google Spreadsheet that can create a sort of calendar for my volunteer org. The aim is to input the information on the left side [ID No., Name, Start Date, and End Date], and, using the dates inputted, automatically generate a calendar and set them into slots based on the inputted dates. I'm assuming they're signing up for every day on and between the dates.</p>
  
  <p>This is a screenshot of the Excel sheet:</p>
  
  <p><img src="https://i.stack.imgur.com/KAonp.png" alt="This is a screenshot of the Excel sheet"></p>
  
  <p>I'm having a little trouble with the formula for creating the automatic slots on the right hand side, as an experienced user can probably tell. I hope to make this as easy as possible for the user (so they don't mess it up)</p>
  
  <p>The formula for G3 (highlighted in the image):</p>
  
  <pre><code>=INDEX($B$3:$B$24,SMALL(IF(G$2&gt;=$C$3:$C$24,ROW($C$3:$C$24)-2),$F3))
  </code></pre>
  
  <p>The formula should be comparing the date above the column with the dates provided (which most likely won't be completely sorted, either). I used INDEX because VLOOKUP only calls the first result every time, and I couple the INDEX with the SMALL so I could keep the order the same as well.</p>
  
  <p>The idea of the formula is to create create the list of volunteers for each day for each of the day's they're available. I've figured out how to generate slots for <strong>after</strong> the days after they're available, but I'm having trouble figuring out how to make it so it take them out on the dates they're no longer available ( as you can see on my example with the sample numbers, it just adds them and there's no way to take them back).</p>
  
  <p>I can't think of way to use IFS or AND-IFS functions to call upon that last row number.</p>