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.
The data: AREAS
Area interval | Name | Number of locations |
---|---|---|
1000-1499 | Area 1 | ? |
1500-1799 | Area 2 | ? |
1800-1999 | Area 3 | ? |
GEOLOCATIONS
Name | Areas List |
---|---|
Location A | 1200, 1400 |
Location B | 1020, 1720 |
Location C | 1700, 1920 |
Location D | 1940, 1950, 1730 |
The result I want here is the number of unique locations in the "Areas list" within the area interval. So Location D should only count ONCE in the 1800-1999 "area", 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 "Areas list"):
Area interval | Name | Number of locations |
---|---|---|
1000-1499 | Area 1 | 2 |
1500-1799 | Area 2 | 3 |
1800-1999 | Area 3 | 2 |
How is this possible?
I have tried with a COUNTIFS, but it doesnt seem to do the job.