Software & Apps MS Office How to Count Data in Selected Cells With Excel's COUNTIF Function COUNTIF combines the IF and COUNT functions by Ted French Writer Former Lifewire writer Ted French is a Microsoft Certified Professional who teaches and writes about spreadsheets and spreadsheet programs. our editorial process Ted French Updated on June 25, 2019 Tweet Share Email MS Office Excel Word Powerpoint Outlook The COUNTIF function combines the IF function and COUNT function in Excel. This combination counts the number of times specific data is found in a selected group of cells. The IF portion of the function determines what data meets the specified criteria and the COUNT part does the counting. Instructions in this article apply to Excel 2019, 2016, 2013, 2010, 2007; Excel for Microsoft 365, Excel Online, Excel for Mac, Excel for iPad, Excel for iPhone, and Excel for Android. Excel COUNTIF Function Syntax In Excel, a function's syntax refers to the layout of the function and includes the function's name, brackets, and arguments. The syntax for the COUNTIF function is: =COUNTIF(Range,Criteria) The function's arguments tell the function what condition is being tested for and what range of data to count when the condition is met. Range: The group of cells the function is to search. Criteria: The value compared with the data in the Range cells. If a match is found, the cell in the Range is counted. Actual data or the cell reference to the data can be entered for this argument. Enter the Example Data Follow the steps in this article to create and use the COUNTIF function. In this example, the COUNTIF function counts the number of sales representatives with more than 250 orders. The first step to using the COUNTIF function in Excel is to enter the data. Enter the data into cells C1 to E11 of an Excel worksheet as shown in the image above. The COUNTIF function and the search criteria (greater than 250 orders) will be added to row 12 below the data. The tutorial instructions do not include formatting steps for the worksheet. Your worksheet will look different than the example shown, but the COUNTIF function will give you the same results. Build the COUNTIF Function Although it is possible to type the COUNTIF function into a cell in a worksheet, it's easier to use the built-in COUNTIF function in Excel to enter the function. Select cell E12 to make it the active cell. This is where the COUNTIF function will be entered. Select the Formulas tab of the ribbon. Choose More Functions > Statistical. Select COUNTIF in the list to open the Function Arguments dialog box. In Excel for Mac, the Function Builder opens. The data entered into the two blank rows in the dialog box form the arguments of the COUNTIF function. These arguments tell the function what condition is being tested for and what cells to count when the condition is met. Highlight the Range Argument The Range argument tells the COUNTIF function which group of cells to search when trying to find the specified criteria. In the Function Arguments dialog box (or the Formula Builder if you're working on a Mac), place the cursor in the Range text box. Highlight cells E3 to E9 on the worksheet to enter these cell references as the range to be searched by the function. Specify the Criteria Argument The Criteria argument tells COUNTIF what data it should find in the Range argument. Although actual data (such as text or numbers like >250) can be entered for this argument, it is best to enter a cell reference into the dialog box (such as D12) and enter the data you want to match into that cell in the worksheet. Place the cursor in the Criteria text box. Select cell D12 to enter that cell reference. The function searches the range selected in the previous step for data that matches whatever data is entered into this cell. Select OK when you're finished. On a Mac, select Done to complete the function. An answer of zero appears in cell E12 (the cell where the function was entered) because data has not been added to the Criteria field (cell D12). =COUNTIF(E3:E9,D12) Add the Search Criteria The last step in the tutorial is to add the criteria the function will match. In this case, the number of Sales Reps with more than 250 orders for the year will be counted. Select cell D12. This is the cell identified in the function as containing the criteria argument. Type >250 and press Enter. The number 4 appears in cell E12. Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Email Address Sign up There was an error. Please try again. You're in! Thanks for signing up. There was an error. Please try again. Thank you for signing up. Tell us why! Other Not enough details Hard to understand Submit