Counts the number of cells within a range that meet the given criteria