In Excel, we have a list of sales orders and we
would like to count how many orders there was a pen in the order. So my list is from A1 to A10
and I’d like to count pen in that list. And to do that I can use
the COUNTIF function. in this cell, start with an equal
sign and type COUNTIF and an open bracket. And the first
argument is which range I would like it to check. I’m going to select A1:A10
I’ll type a comma to end that argument, and the next
argument is the criteria. So what exactly do I want it to count? I’m looking for a text string. So in double quotes, I type in double quote and then Pen and a closing quote, and a closing bracket. And when I press Enter it found
4 pen items in that list. So one, two, three, four, it found all four of our Pen items. And if we have on another worksheet, the same list. Now here
I’ve got pen, Pencil, Gel pen. Maybe I’d like to find anything that
has pen as part of the item name. So not exactly pen, I don’t
want to count just the pens, but I’d like to include the
Gel pen and even a pencil. Here again I’ll use COUNTIF, Start with an equal sign COUNTIF and an open bracket. And then the range is A1:A10 type a comma. And for this now I want it to
include anything that has pen in it. So I’ll type my double quote
mark and then an asterisk. So on my keyboard that was Shift-8
and that’s a wild card character that represents any number of
characters or no characters. And then the text I’m looking for so
I can use upper or lower case there, another asterisk, another double quote
and a closing bracket. It’s going to look for anything
that contains the letters, p e n in a string. There can be anything
before that or nothing. And there can be anything after
those three letters or nothing. And when I press Enter
we get 6. So one, two, three, four, five, six. It found anything that contained
that string of characters, PEN and the case didn’t matter.