Difference between revisions of "Manuals/calci/COUNTIF"
Jump to navigation
Jump to search
Line 30: | Line 30: | ||
{| id="TABLE3" class="SpreadSheet blue" | {| id="TABLE3" class="SpreadSheet blue" | ||
|- class="even" | |- class="even" | ||
− | | | + | | |
− | + | | | |
− | |||
− | |||
− | | | ||
|- class="odd" | |- class="odd" | ||
− | + | | class="sshl_f " | PURPLE | |
− | | class="sshl_f " | | + | | class="sshl_f " | 8 |
− | | class="sshl_f " | | ||
− | |||
− | |||
|- class="even" | |- class="even" | ||
− | + | | class="sshl_f" | RED | |
− | | class="sshl_f" | | + | | class="sshl_f" | 6 |
− | | class="sshl_f" | | ||
− | |||
− | |||
|- class="odd" | |- class="odd" | ||
− | + | | class="sshl_f" | BLUE | |
− | | class="sshl_f" | | + | | class="sshl_f" | 20 |
− | | class="sshl_f" | | ||
− | |||
− | |||
|- class="even" | |- class="even" | ||
− | + | | class=" " | GREEN | |
− | | class=" " | | + | | class=" " | 23 |
− | | class=" " | | ||
− | |||
− | |||
|- class="odd" | |- class="odd" | ||
− | | class=" " | | + | | class=" " | RED |
− | | class=" | + | | class=" " |1 |
− | |||
− | |||
− | |||
|- class="even" | |- class="even" | ||
− | | | + | | class=" " | ORANGE |
− | | | + | | class=" " | 10 |
− | | | + | |- class="odd" |
− | | | + | | class=" " | BROWN |
− | | | + | | class=" " |2 |
|} | |} | ||
<div align="left">[[Image:calci1.gif]]</div></div> | <div align="left">[[Image:calci1.gif]]</div></div> | ||
---- | ---- |
Revision as of 11:36, 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 a given criteria.
Description
COUNTIF(r, c)
For example, COUNTIF(A1:A8,"JOHN") returns the number of cells in the range A1 through A8 that match 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.
- Special 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.
Examples
Consider the following table which shows the color of object in first column and respective count in the second column. COUNTIF() can be used to count the number of cells that match a given criteria within a mentioned range of values.
PURPLE | 8 |
RED | 6 |
BLUE | 20 |
GREEN | 23 |
RED | 1 |
ORANGE | 10 |
BROWN | 2 |