The COUNTIF function is used to count the number of cells in a range that match the supplied criteria and return the result as a number representing cells counted.