For Quarter should be:

<="&EOMONTH($A$1040,2)

What is saying is add 2 months to your data in $A$1040 and then calculate the End of Month Date.

So if A1040 = 4/7/2016, then add 2 months to give 9 then take the end of this month i.e 30/09/2016 (UK date formats!)