---
title: "COUNTIF in Google Sheets: practice exercises | ExcelSavvy"
description: "Practice COUNTIF in Google Sheets: count the cells that meet a condition, in exercises that are checked as you type."
canonical_url: "https://excelsavvy.com/sheets/practice/countif"
meta:
  "og:description": "Practice COUNTIF in Google Sheets: count the cells that meet a condition, in exercises that are checked as you type."
  "og:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~Q09VTlRJRiBpbiBHb29nbGUgU2hlZXRzOiBwcmFjdGljZSBleGVyY2lzZXM%2Cdescription_~UHJhY3RpY2UgQ09VTlRJRiBpbiBHb29nbGUgU2hlZXRzOiBjb3VudCB0aGUgY2VsbHMgdGhhdCBtZWV0IGEgY29uZGl0aW9uLCBpbiBleGVyY2lzZXMgdGhhdCBhcmUgY2hlY2tlZCBhcyB5b3UgdHlwZS4%2Ceyebrow_Google%2BSheets%2Bpractice%2Bexercises%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiLCJEIl0sInJvd3MiOlt7Im4iOjEsImNlbGxzIjpbIk9yZGVyIiwiQ2l0eSIsIkZyb20gQ29wZW5oYWdlbiJdfSx7Im4iOjIsImNlbGxzIjpbIjEwMDEiLCJBYXJodXMiLCIiXX0seyJuIjozLCJjZWxscyI6WyIxMDAyIiwiQ29wZW5oYWdlbiIsIiJdfSx7Im4iOjQsImNlbGxzIjpbIjEwMDMiLCJPZGVuc2UiLCIiXX0seyJuIjo1LCJjZWxscyI6WyIxMDA0IiwiQ29wZW5oYWdlbiIsIiJdfSx7Im4iOjYsImNlbGxzIjpbIjEwMDUiLCJBYWxib3JnIiwiIl19XSwidGFyZ2V0IjpbMSwyXX19%2Cp_Ii9zaGVldHMvcHJhY3RpY2UvY291bnRpZiI%2Cs_ppGS8oFHHJpi5b5F.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "COUNTIF in Google Sheets: practice exercises | ExcelSavvy"
  "twitter:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~Q09VTlRJRiBpbiBHb29nbGUgU2hlZXRzOiBwcmFjdGljZSBleGVyY2lzZXM%2Cdescription_~UHJhY3RpY2UgQ09VTlRJRiBpbiBHb29nbGUgU2hlZXRzOiBjb3VudCB0aGUgY2VsbHMgdGhhdCBtZWV0IGEgY29uZGl0aW9uLCBpbiBleGVyY2lzZXMgdGhhdCBhcmUgY2hlY2tlZCBhcyB5b3UgdHlwZS4%2Ceyebrow_Google%2BSheets%2Bpractice%2Bexercises%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiLCJEIl0sInJvd3MiOlt7Im4iOjEsImNlbGxzIjpbIk9yZGVyIiwiQ2l0eSIsIkZyb20gQ29wZW5oYWdlbiJdfSx7Im4iOjIsImNlbGxzIjpbIjEwMDEiLCJBYXJodXMiLCIiXX0seyJuIjozLCJjZWxscyI6WyIxMDAyIiwiQ29wZW5oYWdlbiIsIiJdfSx7Im4iOjQsImNlbGxzIjpbIjEwMDMiLCJPZGVuc2UiLCIiXX0seyJuIjo1LCJjZWxscyI6WyIxMDA0IiwiQ29wZW5oYWdlbiIsIiJdfSx7Im4iOjYsImNlbGxzIjpbIjEwMDUiLCJBYWxib3JnIiwiIl19XSwidGFyZ2V0IjpbMSwyXX19%2Cp_Ii9zaGVldHMvcHJhY3RpY2UvY291bnRpZiI%2Cs_ppGS8oFHHJpi5b5F.png"
---

> Index of every page on this site: [llms.txt](https://excelsavvy.com/llms.txt)

# **COUNTIF practice in Google Sheets**

COUNTIF counts the cells in a range that meet one condition. In Google Sheets it takes the same two arguments as in Excel and understands the same operators and wildcards.

[**Start the first exercise**](https://excelsavvy.com/sheets/practice/countif/countif-text)

COUNTIF(

## **How COUNTIF works**

COUNTIF counts the cells in a range that meet one condition. It takes two arguments: the range to look in and the criterion. It works the same way in Excel and Google Sheets, and both understand the same operators and wildcards.

`**=COUNTIF(B2:B8,"Copenhagen")**` counts the orders that came from Copenhagen. For numbers, put the operator inside the quotes: `**=COUNTIF(B2:B8,">=1500")**` counts the invoices of 1500 or more. When the limit lives in a cell, join the operator and the cell with &, as in `**=COUNTIF(B2:B7,"<"&E1)**`, so the count follows when E1 changes.

The most common slip is writing the operator and the cell reference together inside the quotes. "\<E1" looks for the literal text, so you need "<"&E1. COUNTIF doesn't care about upper and lower case, so "copenhagen" matches Copenhagen. It handles one condition only. For two or more, use COUNTIFS. The exercises below cover a text condition, a number condition, a limit in a cell, everything except one value and a wildcard.

1. [**1****COUNTIF with a text condition**In D2, use COUNTIF to count how many orders in B2:B8 came from Copenhagen.](https://excelsavvy.com/sheets/practice/countif/countif-text)
2. [**2****COUNTIF with a number condition****Premium**In D2, use COUNTIF to count the invoices in B2:B8 of 1500 or more.](https://excelsavvy.com/sheets/practice/countif/countif-greater-than)
3. [**3****COUNTIF with the limit in a cell****Premium**In E2, count the products in B2:B7 with stock below the reorder level in E1. Join "<" and E1 with &, so the count follows when E1 changes.](https://excelsavvy.com/sheets/practice/countif/countif-criteria-from-a-cell)
4. [**4****Count everything except one value****Premium**In E1, count the tickets in B2:B8 whose status is anything but Closed. "Not equal to" is <>, so the criterion is "<>Closed".](https://excelsavvy.com/sheets/practice/countif/countif-not-equal)
5. [**5****Count with a wildcard****Premium**In D1, count the products in A2:A8 with the word Chair anywhere in the name. \* stands for any text, so the criterion is "\*Chair\*".](https://excelsavvy.com/sheets/practice/countif/countif-wildcard-contains)

## **Functions in this topic**

- [**COUNTIF**](https://excelsavvy.com/sheets/functions/countif)

## **Questions**

<details>

<summary>

### How do I count cells that are not empty with COUNTIF in Google Sheets?

</summary>

Use "&lt;&gt;" as the criterion: =COUNTIF(A2:A10,"&lt;&gt;") counts every cell in A2:A10 that is not empty, as it does in Excel.

</details>

<details>

<summary>

### Can COUNTIF count cells by background color in Google Sheets?

</summary>

No. COUNTIF only looks at the values in the cells, not their formatting, and Sheets has no built-in function for colors. The reliable fix is a helper column that holds the reason for the color, like Overdue, so you can count that value instead. Then the count keeps working when colors change.

</details>

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://excelsavvy.com/#identity","@type":"Organization","name":"ExcelSavvy","url":"https://excelsavvy.com/","logo":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/#website","@type":"WebSite","inLanguage":"en-US","name":"ExcelSavvy","url":"https://excelsavvy.com/","alternateName":["Excel Savvy","ExcelSavvy.com","PracticeExcel","Practice Excel Online"],"publisher":{"@id":"https://excelsavvy.com/#identity"},"workTranslation":[{"@id":"https://excelopgaver.dk/#website"},{"@id":"https://excelpraxis.de/#website"}]},{"@id":"https://excelsavvy.com/sheets/practice/countif#webpage","description":"Practice COUNTIF in Google Sheets: count the cells that meet a condition, in exercises that are checked as you type.","name":"COUNTIF in Google Sheets: practice exercises","url":"https://excelsavvy.com/sheets/practice/countif","@type":["WebPage","CollectionPage","FAQPage"],"breadcrumb":{"@id":"https://excelsavvy.com/sheets/practice/countif#breadcrumb"},"isPartOf":{"@id":"https://excelsavvy.com/#website"},"mainEntity":[{"@id":"https://excelsavvy.com/sheets/practice/countif#/schema/question/1"},{"@id":"https://excelsavvy.com/sheets/practice/countif#/schema/question/2"}],"potentialAction":[{"@type":"ReadAction","target":["https://excelsavvy.com/sheets/practice/countif"]}],"primaryImageOfPage":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/sheets/practice/countif#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://excelsavvy.com","position":1},{"@type":"ListItem","name":"Google Sheets practice exercises","item":"https://excelsavvy.com/sheets","position":2},{"@type":"ListItem","name":"COUNTIF in Google Sheets: practice exercises","position":3}]},{"@id":"https://excelsavvy.com/sheets/practice/countif#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"How do I count cells that are not empty with COUNTIF in Google Sheets?","acceptedAnswer":{"@type":"Answer","text":"Use \"\u003C>\" as the criterion: =COUNTIF(A2:A10,\"\u003C>\") counts every cell in A2:A10 that is not empty, as it does in Excel."}},{"@id":"https://excelsavvy.com/sheets/practice/countif#/schema/question/2","@type":"Question","inLanguage":"en-US","name":"Can COUNTIF count cells by background color in Google Sheets?","acceptedAnswer":{"@type":"Answer","text":"No. COUNTIF only looks at the values in the cells, not their formatting, and Sheets has no built-in function for colors. The reliable fix is a helper column that holds the reason for the color, like Overdue, so you can count that value instead. Then the count keeps working when colors change."}},{"@id":"https://excelsavvy.com/#logo","@type":"ImageObject","caption":"ExcelSavvy","contentUrl":"https://excelsavvy.com/brand/practiceexcel/icon-512.png?v=3","inLanguage":"en-US","url":"https://excelsavvy.com/brand/practiceexcel/icon-512.png?v=3"}]}
```

## Sitemap

See the full [sitemap](https://excelsavvy.com/sitemap.md) for all pages.
