the following formula work fine when cell H2010 is blank, but as soon as i put a date into the cell, the formula returns 0. cell H2009 also contains a date, and the formula works weather it has a date or is blank. the formula resides in cell H2011.
=IF(H2010<>"",AVERAGE(IF(AND(J:J>H2009,J:J<H2010),M:M)),AVERAGE(IF(J:J>H200 9,M:M)))