Monday, June 22, 2009

Excel: COUNTIF Function

Whilst I'm on this Excel kick, let's move on to another useful math function: the COUNTIF function.

With COUNTIF, Excel can search a range of data and count the number of times it finds a specific datapoint or condition. The function's arguments are constructed like so:

Excel COUNTIF Function

In the function, the "range" designates the cell range Excel will be searching. The "criteria" designates the specific datapoint for which Excel is to search and count occurrences.

Excel Table
In the simple table at left, we see a listing of fictional sales transactions and items. Suppose we wanted Excel to count the number of sales of our Zonger product. The COUNTIF function is what we'd use to make it happen!

Since Column C contains the names of the sold items, the range "C5:C15" will constitute the "range" argument in the COUNTIF function. We'll use Cell F5 as our "criteria" argument (see picture below). In it, we've typed the name of the product whose sales we wish to count.

In this case, we'll put the COUNTIF function in Cell F6. It appears as:


And a finished spreadsheet (albeit aesthetically blah) might look like this:

COUNTIF In Action!

As we see, Excel has correctly determined that we sold three Zongers in this invoice batch.

Users who wish to download the above spreadsheet, with its sample usage of the COUNTIF function, can grab it here.

Labels: ,

— Posted by Michael @ 8:22 AM

** Comments Closed on this Post **

Thoughts on my personal finances, goals, experiences, motivations, and accomplishments (or lack thereof).

My financial life began turning around when I took responsibility for it.
— Dave Ramsey


Start (2005-12): ~$21,900
Currently: $0
[About Our Debt Paydown]


Savings Goal: $15,000
Currently: ~$15,115
[About Our Liquid Savings Goal]