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.
![COUNTIF examples](https://support.content.office.net/en-us/media/62fb31d2-e506-4b5d-9b23-f8b49a48f259.png)
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.