I am stuck with extending the formula to a range in a column. I need to implement a "for loop" for the formula below..... Help!!!

This works:
=IF(C2="ABC",IF(D2="XYZ",COUNTIF(Q2,"done")))

I want something like:
=IF(C3:C1000="ABC",IF(D3:D1000="XYZ",COUNTIF(Q3:Q1000,"done")))

Thanks in advance for your help!