# Counting Number Of Unique Entries (CountIf Function)

### Excel function tutorials

I received a question that made me think of something I had tried to do in a spreadsheet a few months ago but never got around to discuss on this blog. Suppose that you have a large set of data that looks like:

There are a large number of things that could be done with such a set of data but one always tricky aspect is getting answers to questions that involve multiple columns. For example, if someone were to ask you, how many different locations of the store sold at least 1 Early Grey Russian black tea box on each day? I cannot simply add up the number of sales since some stores sell multiple boxes. What could I do? I’ll add 2 columns and include the “countif” function which will give me my answer:)

First, I will create a column with a “UniqueID” with the concactenate:

Then, I will use the “countif” function to see if the ID is unique:

As you can see, all numbers that are “1″ are non-Unique. I can then manipulate that column in different ways