Counting cells by using the COUNTIF function
Excel’s COUNTIF function is useful for single-criterion counting formulas. The COUNTIF function takes two arguments:
- range: The range that contains the values that determine whether to include a particular cell in the count
- criteria: The logical criteria that determine whether to include a particular cell in the count
Table 17-2 lists several examples of formulas that use the COUNTIF function. These formulas all work with a range named Data. As you can see, the criteria argument proves quite flexible. You can use constants, expressions, functions, cell references, and even wildcard characters (* and ?).
TABLE 17-2
Examples of Formulas Using the COUNTIF Function
=COUNTIF(Data,12)
Returns the number of cells containing the value 12
=COUNTIF(Data,”<0”)
Returns the number of cells containing a negative value
=COUNTIF(Data,”<>0”)
Returns the number of cells not equal to 0
=COUNTIF(Data,”>5”)
Returns the number of cells greater than 5
=COUNTIF(Data,A1)
Returns the number of cells equal to the contents of cell A1
=COUNTIF(Data,”>”&A1)
Returns the number of cells greater than the value in cell A1
=COUNTIF(Data,”*”)
Returns the number of cells containing text
=COUNTIF(Data,”???”)
Returns the number of text cells containing exactly three characters
=COUNTIF(Data,”budget”)
Returns the number of cells containing the single word budget (not case
sensitive)
=COUNTIF(Data,”*budget*”)
Returns the number of cells containing the text budget anywhere within the text
=COUNTIF(Data,”A*”)
Returns the number of cells containing text that begins with the letter A (not
case sensitive)
=COUNTIF(Data,TODAY())
Returns the number of cells containing the current date
=COUNTIF(Data,”>”&AVERAGE(Data))
Returns the number of cells with a value greater than the average
=COUNTIF(Data,3)+COUNTIF (Data,-3)
Returns the number of cells containing the value 3 or –3
=COUNTIF(Data,TRUE)
Returns the number of cells containing logical TRUE
=COUNTIF(Data,TRUE)
Returns the number of cells containing a logical value (TRUE or FALSE)
// Related Posted - GOOGLE!
Related Websites
- Top 3 Places to Store a Rare Coins Collection When people collect anything of value one of the things they need to know is how and where to store...
- Excel How-to: The SUMIF Function The SUMIF function is an easy way to get a subtotal of specific data that meets a certain condition, without...
- How to clean the registry with CCleaner The registry contains values, keys and data in general that may be totally useless if you delete the executable to...
- Top 3 Things Which Negatively Affect Rare Coin Value Looking at a good coin collection is a thing of beauty. All of the coins will be properly graded and...
- PHP Class for better cache - fileCache Last days I'm working making many changes in Open Classifieds and one of them is this new class to handle...
