title: How to fill data in excel sheet where date lies between a series of date ranges given in another sheet ? Also, a particular column should match
body: <p>I'm working on Social Survey project.Due to discrepancies in data I'm stuck at a certain place. The survey conducting volunteers were given tablets with unique IDs. On different dates, the tablets were used in different cities
  Sheet 1 one contains a list of around thousands of responses for which city names are missing and Sheet 2 contains a list of tablets in use in different cities on different dates.</p>
  
  <p><strong>Sheet 1</strong></p>
  
  <pre><code>City      DeviceID   StartDate     EndDate
  Delhi       25      21-08-2014  26-08-2014
  Mumbai      39      14-05-2014  21-05-2014
  Chennai     91      17-11-2014  21-11-2014
  Bangalore   91      11-10-2014  21-10-2014
  Delhi       91      26-05-2015  29-05-2015
  Hyderabad   25      23-05-2015  28-05-2015
  </code></pre>
  
  <p><strong>Sheet 2</strong></p>
  
  <pre><code>S.Id  DeviceId  SurveyDate  City
  203     91      15-10-2014  ?
  204     25      24-08-2014  ?
  </code></pre>
  
  <p>I need to somehow fill up the values for the city column in Sheet 2.
  I tried using Vlookup but being a beginner to excel, was unable to get things working. I managed to format the string in date columns as date.
  But am unsure about how to pursue this further.</p>
  
  <p>From my understanding, Vlookup requires that the date ranges to be continuous, with no missing values in between. It is not so in this case. This is real world data and hence imperfect.</p>
  
  <p>What would be the right approach to this problem ? Can this be done with excel macros ? 
  I also read up a bit about nested if statements but am confused being a beginner to excel formulas and data manipulation.</p>