How to use Excel's COUNTIF function
If you've learned the
To give you an idea of how this function might be used, check out the following examples.
- Count the number of orders a particular customer has placed based off of an
- Count the number of sales of a particular product based on a
- Count up the number of days during which a particular employee has worked;
- And much more!
Read on for a tutorial on this incredibly useful function.
Defining the problem
Take a look at the spreadsheet below, which lists SnackWorld sales by item and category.
Let's say we want to count up the number of items in the
COUNTIF in action
The formula for
COUNTIF( range, criteria)
Using the formula is simple: simply specify the
COUNTIF( C3:C7, "="& G4)
In the above formula, we first specify the range
Note that in this case, we're using the longform version of
COUNTIF( C3:C7, G4)
Let's take a look at another example in which we count the number of cells that contain values over a certain threshold:
COUNTIF( C3:C6, ">"& F5)
In the above example, we count the number of months in which SnackWorld had more than 7 customers by counting occurences of a value greater than that found in cell
That's it! Now you know how to use the
Save an hour of work a day with these 5 advanced Excel tricks
Work smarter, not harder. Sign up for our 5-day mini-course to receive must-learn lessons on getting Excel to do your work for you.
- How to create beautiful table formatting instantly...
- Why to rethink the way you do VLOOKUPs...
- Plus, we'll reveal why you shouldn't use PivotTables and what to use instead...