you were close with this:
{=MAX(IF($A$1:$A$7="a",$B$1:$B$7))}
You need to filter out the dates that don't match your criteria, which can be done with this:
IF($B$1:$B$7<=date(2013,9,1), ...
IF($B$1:$B$7>=date(2012,8,31), ...
You can't join them using AND
, as it will convert the array to a single value
{=MAX(IF(AND($A$1:$A$7="a",
$B$1:$B$7<=date(2013,9,1),
$B$1:$B$7>=date(2012,8,31)
),$B$1:$B$7))}
will return either the 1st item in the B1:B7 range, or 0, depending on how all the tests went. So the next step is to daisy chain the IF
's together, which gives you this:
{=MAX(IF($A$1:$A$7="a",
IF($B$1:$B$7<=$G$10,
IF(B1:B7>=$F$10,$B$1:$B$7))))}
(spread out so you can see the nesting of the IF statements) Which will now give you the result you want: 8/1/2013