Use COUNTIF to count the number of cells that meet a specific criteria. For example, you are preparing a report and want to count how many sales invoices were greater or lesser than a particular value. Use the COUNTIF function to count numbers greater than or less than a number.
Cells A11 and A12 have formulas where COUNTIF checks the B2:B7 range for the number of invoice values less than 20000 and greater than or equal to 20,000. COUNTIF finds 4 values less than 20000 and 2 values greater than and equal to 20000.