Google Sheets: how to count the set criteria

The tech giant Google gives for everything. You can have multiple functions, accounts and other services for free. The most popular features and services that can be counted are: Google Translator, Google Drive, Google Maps, your browser Google Chrome and more recently, its Officce toolkit: Google Docs, Google Slides and Google Sheets.

The COUNTIF function in Google Sheets, allows you to analyze data in your spreadsheet and returns the number of times it appears in your document. All this if you meet a set of specific criteria. And as is well known, here we explain how to use this function.

Use the COUNTIF function to match a criterion type in Google Sheets

First, you must start Google Sheets and then open a spreadsheet with the data you want to tell.

Now, click on an empty cell and type the following:

= COUNTIF (,)

You must write this in the cell or in the formula input field, replacing and with the range of data to tell you want and the pattern to test, respectively. When you enter the data, it should look more or less like this:

= COUNTIF (F2: I11, «<= 40»)

Then, click on an empty cell and then enter the COUNTIF function with the range and criteria you want to match. After pressing the «Enter» key, the cell will contain the number of times the range matches the exact criteria specified. If the range you want to count contains a text string, it would look like this:

= COUNTIF (C2: C11, “Text”)

However, that function would return zero results since none of the cells in the range contain the exact string “Text”. In this case, unless you use wildcards, the string must match exactly.

You can use wildcards to match all the intances in Google Sheets

Google Sheets: how to count the set criteria

Instead, you must use a wildcard to match all instances of directors with the name “Text” or any other name. You can use wildcards, such as “?” And “*” to match a single character and zero or more contiguous characters, respectively.

To search for each director with the first name «Text», you must use the wildcard «*» in the function. It would look like this:

= COUNTIF (C2: C11, “Text *”)

Instead, use the wildcard “*” to match all instances of “Text” as the first name. If the string you are trying to match contains a real question mark or an asterisk, you can add the prefix tilde (~) as an escape character (that is, ~? Y ~ *).

Use COUNTIFS to join multiple criteria

COUNTIF is excellent if you only need to match according to a specific type of criteria. If you have more than one criterion, you must use the COUNTIFS function. It works exactly like COUNTIF, except that it accepts more than one rank and more than one criterion. Any additional range must have the same number of rows and columns as the first range.

You can simply add as many ranges and criteria that you want to count in the function. The format is basically the same as COUNTIF. It should look more or less like this:

= COUNTIFS (C3: C11, “George *”, D3: D11, “> = 1990”)

Whether you want to count a single set of criteria in a range or several, the use of COUNTIF and COUNTIFS to help analyze the data within your spreadsheet. And this is how you can count criteria and make use of multiple functions in Google Sheets.