Difference between revisions of "Manuals/calci/COUNTIF"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div id="6SpaceContent" class="zcontent" align="left">  '''COUNTIF (R, C)''' '''Where r is the range of cells and c is the criteria in the form of a number, expression,...")
 
Line 1: Line 1:
<div id="6SpaceContent" class="zcontent" align="left"> 
+
=COUNTIF(r, c)=
  
'''COUNTIF (R, C)'''
+
*Where 'r' is the range of cells
 +
*'c' is the criteria in the form of a number, expression, cell reference, or text.
 +
*COUNTIF function calculates the number of cells that satisfy the given criteria.
  
'''Where r is the range of cells and c is the criteria in the form of a number, expression, cell reference, or text.'''
+
== Description ==
 +
COUNTIF(r, c)
  
</div>
+
For example, COUNTIF(A1:A8,"JOHN") returns the number of cells in the range A1 through A8 and which matches with the text "JOHN".
----
 
<div id="1SpaceContent" class="zcontent" align="left">
 
  
This function calculates the number of cells within a range.
+
*Criteria containing numbers can be expressed as 66, "66","<=66", ">=66", "<>66" etc.
  
</div>
+
*Criteria with text values can be expressed in quotes as "Red" etc.
----
 
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">
 
  
COUNTIF
+
*Combination of functions can also be used as COUNTIF(A1:A3,"Red")+COUNTIF(A4:A7,"Orange") etc.
 +
 
 +
*Wild card characters such as '*', '?', '~' can be used in the criteria field to match a certain sequence of characters.
 +
 
 +
*COUNT() can be used to count the number of cells in the given range except logical values, error values and text.
 +
 
 +
*COUNTA() can be used to count the number of non-empty cells that may be numbers, number representation of a text, error or logic values, dates etc.
  
 
</div></div>
 
</div></div>

Revision as of 11:12, 4 November 2013

COUNTIF(r, c)

  • Where 'r' is the range of cells
  • 'c' is the criteria in the form of a number, expression, cell reference, or text.
  • COUNTIF function calculates the number of cells that satisfy the given criteria.

Description

COUNTIF(r, c)

For example, COUNTIF(A1:A8,"JOHN") returns the number of cells in the range A1 through A8 and which matches with the text "JOHN".

  • Criteria containing numbers can be expressed as 66, "66","<=66", ">=66", "<>66" etc.
  • Criteria with text values can be expressed in quotes as "Red" etc.
  • Combination of functions can also be used as COUNTIF(A1:A3,"Red")+COUNTIF(A4:A7,"Orange") etc.
  • Wild card characters such as '*', '?', '~' can be used in the criteria field to match a certain sequence of characters.
  • COUNT() can be used to count the number of cells in the given range except logical values, error values and text.
  • COUNTA() can be used to count the number of non-empty cells that may be numbers, number representation of a text, error or logic values, dates etc.

Syntax

Examples

Description

Lets see an example,

COUNTIF(R,C)

B              C

'

P             50

Q             65

R             90

P            151

=COUNTIF(B2:B5,"P") is 2

=COUNTIF(C2:C5,">66") is 2


Column1 Column2 Column3 Column4
Row1 P 50 2
Row2 Q 65 2
Row3 R 90
Row4 P 151
Row5
Row6