The COUNTIF function combines the IF function and the COUNT function in Excel. This combination counts how often certain data has been found in the selected group of cells. The IF part of the function determines which data matches the specified criteria, and the COUNT part performs the count.
The instructions in this article apply to Excel 2019, 2016, 2013, 2010, 2007; Excel for Office 365, Excel Online, Excel for Mac, Excel for iPad, Excel for iPhone, and Excel for Android.
- Excel COUNTIF Function Syntax
- Enter sample data
- Create a COUNTIF function
- Highlight the range argument
- Specify Criteria Argument
- Add search criteria
Excel COUNTIF Function Syntax
In Excel, function syntax refers to the layout of the function and includes the function name, parentheses, and arguments. The syntax for the COUNTIF function is:
= СЧЕТЕСЛИ ( Диапазон , Критерии )
Function arguments tell the function what condition it is tested for and what range of data to consider when the condition is met.
Range : a group of cells whose function is to search.
criteria † The value compared to the data in the range cells. If a match is found, the cell in the range is considered. For this argument, you can enter actual data or a reference to a data cell.
Enter sample data
Follow the instructions in this article to create and use the COUNTIF function. In this example, the COUNTIF function counts the number of sellers with more than 250 orders.
The first step to use the COUNTIF function in Excel is data entry. Enter data in cells C1 to E11 of the Excel worksheet as shown in the image above. The COUNTIF function and search criteria (more than 250 orders) are added in line 12 below the data.
The tutorial instructions do not include formatting steps for the worksheet. Your worksheet will be different from the worksheet in the example, but the COUNTIF function will give you the same results.
Create a COUNTIF function
Although it is possible to enter the COUNTIF function in a cell on a worksheet, it is easier to enter the function by using the built-in COUNTIF function in Excel.
Select cell E12 to make it the active cell. Here the COUNTIF function is introduced.
Select tab formulas on the adhesive tape †
Select Additional Features † Statistical data †
Select COUNTIF in the list to open the Function Arguments dialog box. Function Builder opens in Excel for Mac.
The data entered on the two blank lines in the dialog are the arguments for the COUNTIF function. These arguments tell the function what condition to test for and which cells to consider when the condition is met.
Highlight the range argument
The Range argument tells the COUNTIF function what group of cells to search for when searching for the specified criteria.
In the Function Arguments dialog box (or Formula Builder if you’re using a Mac), place your cursor in the Range text box.
Select cells from E3 before E9 on the worksheet to enter those cell references as the range the function looks for.
Specify Criteria Argument
The Criteria argument tells COUNTIF what data to find in the Range argument. While you can enter actual data for this argument (such as text or numbers, such as >250), it is best to enter a cell reference in the dialog box (such as D12) and enter the data you want to match in that cell. to be entered in the worksheet.
Place the cursor in the Criteria text box.
Select cell D12 to enter a reference to that cell. The function searches the range selected in the previous step for data that matches data entered in that cell.
Click Okay when you’re done. Select on a Mac Finished to end the function.
A null response appears in cell E12 (the cell where the function was entered) because no data was added to the Criteria field (cell D12).
= СЧЕТЕСЛИ (Е3: Е9, Д12)
Add search criteria
The last step in the tutorial is to add the criteria that the feature will meet. In this case, the number of sellers with more than 250 orders per year is taken into account.
Select cell D12 † This is the cell defined in the function as the cell containing the criteria argument.
Enter > 250 and press Enter †
The number 4 appears in cell E12.