Count missing values under specific date conditions

See the FAQ on crossposting. Please post back if you find a solution on S/O.