IF Statements in Excel are some of the most useful functions you can use. There are a variety of IF functions and each one can be used for a variety of purposes. Over the next few weeks, we will explore the various IF functions, their uses and how to create them. This week, we are focusing on the CountIF Function.
IF statements are often variations on standard functions, but they allow you to return a value based on specified criteria. The normal Count formula (=count(range)) will return the total number of cells containing data within a range. Here’s a quick demo:
As you can see, it just counted the total number of cells with data.
But let’s say you wanted to count the total sales to a particular company. In this case, you could use the CountIF function to find the total sales to a company.
The syntax for CountIF is:
So, if we’re going to find the totals to Eastern Company, the formula becomes:
=countif(F2:F21, “Eastern Company”)
And that will the return the specified value:
Note: if the value you’re using as the specified criteria also exists in the table, you can select any cell containing that value rather than writing it out:
The above examples are if the value you’re looking for is an Exact Match. You can also do greater or less than.
Let’s say you wanted to find the total number of sales greater than $300. For that you would use this formula:
Now in some cases you might want to it count equal to And less than (or greater than). In those cases, you will add the = sign after you enter the greater than (>) or less than (<) symbol.
So, now that we know the number of cells containing values greater than 300, let’s find the number of cells that are equal to or less than 300. That formula looks like:
As you can see, this than finds any cell with 300 or less:
We here at Learn Excel Now hope you now feel comfortable using the CountIF Function. We will be brining you more IF statement tips over the next several weeks so stay tuned!
Like Learn Excel Now? Follow us on social media and share our content with your networks! And don’t forget to sign up for the Newsletter
Kevin – Learn Excel Now