Test if a date falls within a given range of dates in Excel?
lindaledb wrote:
On second thought.....
After testing this further and looking at the code you suggested, I see that
in the formula you provided =INDEX(A4:A9,MATCH(B2,B4:B9,-1)) that it is only
looking up the dates in column B. I tried expanding that to B4:C9, but that
messes everything up.
Each age division has its own date range. For example, a Junior must have
been born between 9/1/2000 and 8/31/1997 (as seen in cells B6 and C6). I'm
not all that familiar with Index and Match, so when you suggested the range
of B4:B9, I'm assuming that Excel is looking from 9/1/2008 to 9/1/1989
instead of each individual row's range???? Am I making sense?
Is there an easier way to organize this or to alter the formula?
Again, thanks for your (or other's) suggestions!
Sorry I didn't get back to you sooner.
From what I can tell, your ranges don't overlap and there are no gaps between
ranges, making the end date irrelevant. The formula only needed to find the
smallest start date that is greater than or equal to the Date of Birth.
Despite your worries, when you did further testing did you get the correct result?
Although it may not be much help, try looking at the help file for INDEX and MATCH.
|