In case your Excel data include several variations of the keyword(s) you want to count, then you can use a wildcard character to count all the cells containing a certain word, phrase or letters as part of the cell's contents.
As shown in the screenshot below, the formula =COUNTIF(D2:D9,5) perfectly counts cells with quantity 5 in Column D.ĬOUNTIF formulas with wildcard characters (partial match) Similarly, COUNTIF formulas work for numbers. Instead of typing text, you can use a reference to any cell containing that word or words and get absolutely the same results, e.g. A word or several words enclosed in quotes as the criteria.Let me remind you that formula for cells containing an exact string of text: =COUNTIF(C2:C15,"Roger Federer"). In fact, we discussed the COUNTIF function that counts text values matching a specified criterion exactly a moment ago. COUNTIF formula for text and numbers (exact match) This diversity makes the COUNTIF function really powerful and fit for many tasks, as you will see in the examples that follow. However, it allows for many possible variations of the criteria, including wildcard characters, the values of other cells, and even other Excel functions. Excel COUNTIF function examplesĪs you have just seen, the syntax of the COUNTIF function is very simple. A criterion is case insensitive, meaning that if you type "roger federer" as the criteria in the above formula, this will produce the same result. The syntax of the COUNTIF function is very simple: Another typical use of COUNTIF in Excel is for counting cells with a specific word or starting with a particular letter(s). Excel COUNTIF - frequently asked questions and issuesĬOUNTIF function in Excel - syntax and usageĮxcel COUNTIF function is used for counting cells within a specified range that meet a certain criterion, or condition.įor example, you can write a COUNTIF formula to find out how many cells in your worksheet contain a number greater than or less than the number you specify.Count if greater than, less than or equal to.COUNTIF with wildcard characters (partial match).
COUNTIF formula for text and numbers (exact match).