Home
Microsoft Office Excel 2007 Tutorial
Introduction
Editing
Format Style
Table
Chart
Formula
Workbook Worksheet
Wordart Clip Art Shape Picture
PivotTable PivotChart
Data Analysis
Macro ActiveX Add in
Security
Collaboration
Database functions
Date Time functions
Engineering functions
Information functions
Logical functions
Lookup Reference functions
Math Trigonometry functions
Statistical functions
Text functions
=COUNTIF(A2:A7,"*") returns the number of cells containing text in the first column above : COUNTIF « Statistical functions « Microsoft Office Excel 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Statistical functions
COUNTIF
Input the formula: =COUNTIF(A2:A7,
"*"
). Press Enter to get the result.
21.14.COUNTIF
21.14.1.
=COUNTIF(A2:A5,A1) return the number of cells with condition in A1
21.14.2.
=COUNTIF(B2:B5,">55") return the number of cells with a value greater than 55
55") return the number of cells with a value greater than 55" src="http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/countifb2b5gt55_Return_Number_Of_Cells_With_V___Input_Formula_countifb2b555.PNG" width=200 height=40>
21.14.3.
=COUNTIF(B2:B5,"<>"&B4) returns the number of cells with a value not equal to the value in B4
"&B4) returns the number of cells with a value not equal to the value in B4" src="http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/countifb2b5ltgtampb4returns_Number_Of_Cell___Input_Formula_co2b5b4.PNG" width=200 height=40>
21.14.4.
=COUNTIF(A2:A7,"*e") returns the number of cells ending with the letters "e"
21.14.5.
=COUNTIF(A2:A7,"???e") returns the number of cells ending with the letters "e" and having exactly 4 letters
21.14.6.
=COUNTIF(A2:A7,"*") returns the number of cells containing text in the first column above
21.14.7.
=COUNTIF(A2:A7,"<>"&"*") returns the number of cells not containing text
"&"*") returns the number of cells not containing text" src="http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/countifa2a7ltgtamp_Returns_Number_Of_Cel___Input_Formula_countifa2a7.PNG" width=200 height=40>