A revised version of this content is now available at blog.officewizkid.com
Here is a classic situation:
I have an Excel file with data column, the data column holds multiple strings. Let’s say something like in the table below:
If my goal was to count the number of rows that has the exact value of “Money” then the function was simple:
And the value in the above example would have been 1.
But what if my goal is to count the number of rows that contain the value “Money” regardless if this is the complete value or part of a bigger string?
Apparently there is a simple way to do that:
The value for the previous data set is 5, as it counts the cells containing any of the following strings:
something money something, Money, somthingmoneysomething, somethingmoney, moneysomething
In fact the COUNTIF function is a little bit more sophisticated than it initially looks. The criteria part can have a wildcards (such as *) and also numeric comparison functions such as “>” or “<”.
You can find more information on the criteria part of COUNTIF at the following place: