Use a function as the criteria in the Excel =COUNTIF() function
Posted on 2013-06-04
Syntax: =COUNTIF(range, criteria)
How do you insert a function rather than a value for the criteria in the Excel =COUNTIF() function?
For example, suppose you have a list of the names of cities in the range A2:A100. And suppose you want to count the number of city names in that range which have more than one word.
I realize that you could use the following formula pasted down in column B to identify cities with one or more spaces:
and then use the column B results as the criteria in the =COUNTIF() function as follows:
However, is there a way to include the desired criteria directly in the =COUNTIF() function so that a second column need not be tied up?