Im with xl on this, but see if countifS() will work for you?