title: Counting if part of string is within interval
body: <p>I am currently trying to check if a number in a comma-separated string is within a number interval. What I am trying to do is to check if an area code (from the comma-separated string) is within the interval of an area.</p>
  <h2>The data:
  AREAS</h2>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Area interval</th>
  <th>Name</th>
  <th>Number of locations</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1000-1499</td>
  <td>Area 1</td>
  <td>?</td>
  </tr>
  <tr>
  <td>1500-1799</td>
  <td>Area 2</td>
  <td>?</td>
  </tr>
  <tr>
  <td>1800-1999</td>
  <td>Area 3</td>
  <td>?</td>
  </tr>
  </tbody>
  </table>
  </div><h2>GEOLOCATIONS</h2>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Name</th>
  <th>Areas List</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Location A</td>
  <td>1200, 1400</td>
  </tr>
  <tr>
  <td>Location B</td>
  <td>1020, 1720</td>
  </tr>
  <tr>
  <td>Location C</td>
  <td>1700, 1920</td>
  </tr>
  <tr>
  <td>Location D</td>
  <td>1940, 1950, 1730</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The result I want here is the number of unique locations in the &quot;Areas list&quot; within the area interval. So Location D should only count ONCE in the 1800-1999 &quot;area&quot;, and the Location A the same in the 1000-1499 location. But location B should count as one in both 1000-1499 and one in 1500-1799 (because a number from each interval is in the comma-separated string in &quot;Areas list&quot;):</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Area interval</th>
  <th>Name</th>
  <th>Number of locations</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1000-1499</td>
  <td>Area 1</td>
  <td>2</td>
  </tr>
  <tr>
  <td>1500-1799</td>
  <td>Area 2</td>
  <td>3</td>
  </tr>
  <tr>
  <td>1800-1999</td>
  <td>Area 3</td>
  <td>2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>How is this possible?</p>
  <p>I have tried with a COUNTIFS, but it doesnt seem to do the job.</p>