# COUNTIF in Google Sheets: how to use the function in Google’s spreadsheet program

The **COUNTIF function** is a well-established function in [Excel](https://www.ionos.ca/digitalguide/online-marketing/web-analytics/countif-in-excel/ "COUNTIF in Excel") as well as other programs such as Google Sheets. COUNTIF lets users count **different values** based on one or more conditions. Google Sheets, the web-based Office solution, provides a practical alternative to Microsoft’s Office.

COUNTIF in Google Sheets finds a wide range of application, from counting dates to calculating similar products or names in a list. Conditions can be **text-based,** which means that not only numerical values are counted. In accounting, the COUNTIF function is also used to create registers and listings for the last few months to help users gain a quick overview of their received invoices and amounts due.

The generic formula for **conditional counting** in Google is as follows:

```none
=COUNTIF (range; criteria)
```

## Using COUNTIF in Google Sheets: step by step

The COUNTIF function is a great solution to calculate multiple values in a data set using one or more conditions. Once you know the **generic formula** (above), the remaining steps in Google only take a few minutes. The individual steps are as follows:

1. Launch a new or existing Google Sheets spreadsheet.

[![Image: Google Sheets: empty spreadsheet ](https://www.ionos.ca/digitalguide/fileadmin/_processed_/e/4/csm_EN-google-countif-function-1_117d5ba20d.webp "Google Sheets: empty spreadsheet ")](https://www.ionos.ca/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/EN-google-countif-function-1.jpg) Google Sheets: empty spreadsheet       2. Enter the values you wish to count in the table.

[![Image: Example data in Google Sheets ](https://www.ionos.ca/digitalguide/fileadmin/_processed_/a/1/csm_EN-google-countif-function-2_f9bb8085b1.webp "Example data in Google Sheets ")](https://www.ionos.ca/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/EN-google-countif-function-2.jpg) Example data in Google Sheets       3. Now, you can enter the COUNTIF function into the desired cell or add it from the menu options. To do the latter, select “**Insert”** and then “**Function**.” Now, scroll to “**Mathematics”** and select “**COUNTIF**.”

[![Image: Adding the COUNTIF function in Google Sheet using the menu ](https://www.ionos.ca/digitalguide/fileadmin/_processed_/f/5/csm_EN-google-countif-function-3_e14d5f0eee.webp "Adding the COUNTIF function in Google Sheet using the menu ")](https://www.ionos.ca/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/EN-google-countif-function-3.jpg) Adding the COUNTIF function in Google Sheet using the menu       4. The formula will be added to the marked cell.

[![Image: Example Google Sheet with COUNTIF function in cell ](https://www.ionos.ca/digitalguide/fileadmin/_processed_/8/c/csm_EN-google-countif-function-4_d812496b8b.webp "Example Google Sheet with COUNTIF function in cell ")](https://www.ionos.ca/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/EN-google-countif-function-4.jpg) An example of adding the COUNIF function in a cell in Google Sheets       5. Let’s assume you want to view the **number of invoices** that contain a **lower amount than 6,000**. Select an empty cell to enter the formula and specify the **range of cells** (cell numbers) you want to begin the count from. In the example below, counting will begin in cell B2. Place a **colon** to specify “from-to.” Counting will now begin in cell B2 and finish in cell B5.

[![Image: Google Sheets: selected range of values for COUNTIF ](https://www.ionos.ca/digitalguide/fileadmin/_processed_/a/2/csm_EN-google-countif-function-5_7b48f68066.webp "Google Sheets: selected range of values for COUNTIF ")](https://www.ionos.ca/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/EN-google-countif-function-5.jpg) Google Sheets: selected range of values for COUNTIF       6. You’ve now specified the counting range, but haven’t added a condition for counting. You will need to **define your conditions within the formula**. In this case, we are looking for values smaller than 6,000. Place a **semicolon** behind the last cell to be counted (B5, in this case). Use **quotation marks** to specify the condition "&lt;6000" and close the formula by adding a **round bracket**.

[![Image: Google Sheets: COUNTIF function with added condition ](https://www.ionos.ca/digitalguide/fileadmin/_processed_/f/0/csm_EN-google-countif-function-6_8adf36aca4.webp "Google Sheets: COUNTIF function with added condition ")](https://www.ionos.ca/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/EN-google-countif-function-6.jpg) Google Sheets: COUNTIF function with added condition       7. Now hit Enter to begin counting. The result will be a number that tells you how many invoices of an amount lower than 6,000 were present in the range specified. In this example, there were two values that met the conditions for counting (3,000 and 4,000).

[![Image: Google Sheets: result of COUNTIF function ](https://www.ionos.ca/digitalguide/fileadmin/_processed_/c/0/csm_EN-google-countif-function-7_5d6ecf523d.webp "Google Sheets: result of COUNTIF function ")](https://www.ionos.ca/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/EN-google-countif-function-7.jpg) Google Sheets: result of COUNTIF function       Just like you can search for values below 6,000, you could have searched for invoices greater than 6,000 using “&gt;” or equal to “=” a specified amount. COUNTIF in Google Sheets also lets you search according to **multiple criteria**. If, for example, you’d like to count the number of entries below 6,000 and those above 12,000, you could use the following code to **specify both conditions**.

```none
(=COUNTIF (B2:B500;"<6000";B2:B500;">=12000")
```

You may also want to count invoices according to the **date you received them**. For example, to count all invoices received before 31.01.2020, use the following code:

```none
(=COUNTIF (B2:B5;"<31/1/2020")
```

Google Sheets lets multiple users work on a spreadsheet at the same time. That means a single list can be processed by individual departments. For example, accounting may wish to know how many invoices are outstanding in a given time frame, while the marketing department may use the COUNTIF function to check how often certain customers made a purchase.


This is a markdown version of: [https://www.ionos.ca/digitalguide/online-marketing/online-sales/countif-in-google-sheets/](https://www.ionos.ca/digitalguide/online-marketing/online-sales/countif-in-google-sheets/) for AI/LLM consumption.