A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
A bit confused by what you want. Are you looking to count the number of occasion where the date under ATP1 is less than or equal to 31/5 and ATP2 is greater than 31/5/2010. And separately you want to count the number of times ATP2 is less than 31/5/2010?
If so, see this whether work for you.
to count scenario 1 =SUMPRODUCT(--(E2:E4<=DATE(2010,5,31)),--(F2:F4>DATE(2010,5,31)))
for scenario 2 =COUNTIF(F2:F4,"<31/5/2010")
Change the range as required