The COUNTIF function counts the number of cells that meet a specified condition. For example, =COUNTIF(A1:A10, ">10") counts how many cells in A1 to A10 have values greater than 10.