Do you have a set of data in Excel and you want to count a certain number of items that comply multiple conditions? Then you can use the function COUNTIFS. I’ll give you an example to illustrate this situation better.

Let’s say you have a T-shirt shop and have sales data saved in an Excel spreadsheet. Let’s assume that you want to know the number of Black, Male T-shirts that you have sold. See the example below.

Wim Jellema countifs example

The formula used here is: =COUNTIFS(F2:F13;”Black”;G2:G13;”Male”)

Now let’s explain this a bit. The COUNTIFS function syntax is as follows:

COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)

So in this case the criteria_range1 is cell F2 to F13 and the criteria1 to count in this cell range is “Black”. You have to use at least one criteria range and criteria combination. Any extra range/criteria combination is optional. You can add up to 127 range/criteria combinations.