For business users of Microsoft Excel Free guides and templates
Home >  Excel Help >  Excel Functions >  


COUNTIF Function

Counts the number of cells that meet one criteria

by Charley Kyd, MBA
Microsoft Excel MVP, 2005-2014
The Father of Spreadsheet Dashboard Reports



  • range  Required. One or more cells to count, including numbers or names, arrays, or references that contain numbers. Blank and text values are ignored.
  • criteria  Required. A number, expression, cell reference, or text string that defines the cells to be counted. (See the examples below.)

Applies To

Excel 2003 and above


You can download this example workbook here, along with all other example workbooks I've completed for this Excel help area.

Examples for Excel's COUNTIF function
  • Example 1: COUNTIF ignores both text and the logical value. 
  • Example 2: COUNTIF ignores error values.
  • Example 3: All text but "a" is greater than or equal to "b".
  • Example 4: If you're looking for one string, an equal sign isn't needed.
  • Example 5: The "*" wildcard refers to any number of characters that preceed "ts".
  • Example 6: Both "?" and "*" can be used any number of times in the same criteria, and "*" also can apply to no characters at all.
  • Example 7: The "?" does not apply when no ending character exists.
  • Example 8: The "=" criteria, with nothing after it, searches for "=(nothing)", and therefore counts the four blank cells.

Other Help


Charley's SwipeFile charts

Free Excel Dashboards