It seems like this should be straightforward, but I can't figure it out.
The extent of my knowledge of excel formulas comes my ability to google....

Sheet 1: list of names, etc and birthdays (K is birthdays)

Sheet 2: birthday range with an assigned group name (B is beginning range, C is ending range, D is assigned group name)
9/1/1900 8/31/2002 group 7
9/1/2002 8/31/2007 group 6
9/1/2007 8/31/2008 group 5
9/1/2008 8/31/2009 group 4
9/1/2009 8/31/2010 group 3
9/1/2010 8/31/2011 group 2
9/1/2011 8/31/2012 group 1
9/1/2012 8/31/2013 unassigned

Sheet 1 Column M is the code
=IF(ISERROR(INDEX(Sheet2!$D$2:$D$9,MATCH(SUMPRODUCT((Sheet2!$B$2:$B$9<=Sheet1!K2)*(Sheet2!$C$2:$C$9>=Sheet1!K2)*(Sheet2!$B$2:$B$9)),Sheet2!$B$2:$B$9,0))),"Not Found",INDEX(Sheet2!$D$2:$D$9,MATCH(SUMPRODUCT((Sheet2!$B$2:$B$9<=Sheet1!K2)*(Sheet2!$C$2:$C$9>=Sheet1!K2)*(Sheet2!$B$2:$B$9)),Sheet2!$B$2:$B$9,0)))

I don't know if I wrote that correctly, but it works.
When I tried a lookup formula, it kept getting N/A for any birthday before 2002.
So this formula works.

Now I'd like to do a COUNTIF for the final tally on number of group members.
I tried =COUNTIF(Sheet1!$M$2:$M$167,"group 1") but it's not tallying any of the groups.

Advice?