---
title: "COUNTIF practice: 5 exercises with answers | ExcelSavvy"
description: "Practice COUNTIF in Excel with text and number conditions, a limit kept in a cell, everything except one value and wildcards. Checked instantly."
canonical_url: "https://excelsavvy.com/practice/countif"
meta:
  "og:description": "Practice COUNTIF in Excel with text and number conditions, a limit kept in a cell, everything except one value and wildcards. Checked instantly."
  "og:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~Q09VTlRJRiBwcmFjdGljZTogNSBleGVyY2lzZXMgd2l0aCBhbnN3ZXJz%2Cdescription_~UHJhY3RpY2UgQ09VTlRJRiBpbiBFeGNlbCB3aXRoIHRleHQgYW5kIG51bWJlciBjb25kaXRpb25zLCBhIGxpbWl0IGtlcHQgaW4gYSBjZWxsLCBldmVyeXRoaW5nIGV4Y2VwdCBvbmUgdmFsdWUgYW5kIHdpbGRjYXJkcy4gQ2hlY2tlZCBpbnN0YW50bHku%2Ceyebrow_Excel%2Bpractice%2Bexercises%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiLCJEIl0sInJvd3MiOlt7Im4iOjEsImNlbGxzIjpbIk9yZGVyIiwiQ2l0eSIsIkZyb20gQ29wZW5oYWdlbiJdfSx7Im4iOjIsImNlbGxzIjpbIjEwMDEiLCJBYXJodXMiLCIiXX0seyJuIjozLCJjZWxscyI6WyIxMDAyIiwiQ29wZW5oYWdlbiIsIiJdfSx7Im4iOjQsImNlbGxzIjpbIjEwMDMiLCJPZGVuc2UiLCIiXX0seyJuIjo1LCJjZWxscyI6WyIxMDA0IiwiQ29wZW5oYWdlbiIsIiJdfSx7Im4iOjYsImNlbGxzIjpbIjEwMDUiLCJBYWxib3JnIiwiIl19XSwidGFyZ2V0IjpbMSwyXX19%2Cp_Ii9wcmFjdGljZS9jb3VudGlmIg%2Cs_cNp0Ya08TQBaLugM.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "COUNTIF practice: 5 exercises with answers | ExcelSavvy"
  "twitter:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~Q09VTlRJRiBwcmFjdGljZTogNSBleGVyY2lzZXMgd2l0aCBhbnN3ZXJz%2Cdescription_~UHJhY3RpY2UgQ09VTlRJRiBpbiBFeGNlbCB3aXRoIHRleHQgYW5kIG51bWJlciBjb25kaXRpb25zLCBhIGxpbWl0IGtlcHQgaW4gYSBjZWxsLCBldmVyeXRoaW5nIGV4Y2VwdCBvbmUgdmFsdWUgYW5kIHdpbGRjYXJkcy4gQ2hlY2tlZCBpbnN0YW50bHku%2Ceyebrow_Excel%2Bpractice%2Bexercises%2Csite_practiceexcel%2Cprops_eyJncmlkIjp7ImNvbHMiOlsiQSIsIkIiLCJEIl0sInJvd3MiOlt7Im4iOjEsImNlbGxzIjpbIk9yZGVyIiwiQ2l0eSIsIkZyb20gQ29wZW5oYWdlbiJdfSx7Im4iOjIsImNlbGxzIjpbIjEwMDEiLCJBYXJodXMiLCIiXX0seyJuIjozLCJjZWxscyI6WyIxMDAyIiwiQ29wZW5oYWdlbiIsIiJdfSx7Im4iOjQsImNlbGxzIjpbIjEwMDMiLCJPZGVuc2UiLCIiXX0seyJuIjo1LCJjZWxscyI6WyIxMDA0IiwiQ29wZW5oYWdlbiIsIiJdfSx7Im4iOjYsImNlbGxzIjpbIjEwMDUiLCJBYWxib3JnIiwiIl19XSwidGFyZ2V0IjpbMSwyXX19%2Cp_Ii9wcmFjdGljZS9jb3VudGlmIg%2Cs_cNp0Ya08TQBaLugM.png"
---

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

# **COUNTIF practice exercises**

Count the cells that meet a condition: a text match, a number comparison or a criterion kept in its own cell.

[**Start the first exercise**](https://excelsavvy.com/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/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/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/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/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/practice/countif/countif-wildcard-contains)

## **Functions in this topic**

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

## **Read the guide**

- [**Excel test for a job interview: what it looks like and how to practice**](https://excelsavvy.com/learn/excel-for-job-interviews)
- [**Free Excel course online: learn Excel from your first formula to job-ready**](https://excelsavvy.com/learn/how-to-learn-excel)
- [**Pivot tables explained, and the formulas that do the same job**](https://excelsavvy.com/learn/pivot-tables)
- [**Excel data cleaning practice: a messy file with tasks and answers**](https://excelsavvy.com/learn/excel-data-cleaning-practice)

## **Questions**

<details>

<summary>

### How do I use COUNTIF with multiple criteria?

</summary>

Use COUNTIFS when all the conditions must be true: =COUNTIFS(B2:B8,"Copenhagen",C2:C8,"&gt;=1500") counts the rows that match both. For "this or that", add two COUNTIFs: =COUNTIF(B2:B8,"Copenhagen")+ COUNTIF(B2:B8,"Aarhus"). Add the results only if no row can match both.

</details>

<details>

<summary>

### Why does COUNTIF return 0 when the value is clearly there?

</summary>

Usually the cell holds something slightly different: an extra space at the end, a number stored as text, or a typo in the criterion. Try the TRIM function on the data, or use a wildcard like "\*Copenhagen\*" to catch the extra characters. A criterion longer than 255 characters returns #VALUE!.

</details>

<details>

<summary>

### How do I count dates in a range with COUNTIF?

</summary>

Compare against a date and join it with &amp;: =COUNTIF(B2:B20,"&gt;="&amp;DATE(2025,1,1)) counts every date from January 1, 2025 on. Use COUNTIFS with a start and an end date for a period. You can also put the date in a cell and write "&gt;="&amp;E1.

</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/practice/countif#webpage","description":"Practice COUNTIF in Excel with text and number conditions, a limit kept in a cell, everything except one value and wildcards. Checked instantly.","name":"COUNTIF practice: 5 exercises with answers","url":"https://excelsavvy.com/practice/countif","@type":["WebPage","CollectionPage","FAQPage"],"breadcrumb":{"@id":"https://excelsavvy.com/practice/countif#breadcrumb"},"isPartOf":{"@id":"https://excelsavvy.com/#website"},"mainEntity":[{"@id":"https://excelsavvy.com/practice/countif#/schema/question/1"},{"@id":"https://excelsavvy.com/practice/countif#/schema/question/2"},{"@id":"https://excelsavvy.com/practice/countif#/schema/question/3"}],"potentialAction":[{"@type":"ReadAction","target":["https://excelsavvy.com/practice/countif"]}],"primaryImageOfPage":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/practice/countif#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://excelsavvy.com","position":1},{"@type":"ListItem","name":"Excel practice exercises","item":"https://excelsavvy.com/practice","position":2},{"@type":"ListItem","name":"COUNTIF practice: 5 exercises with answers","position":3}]},{"@id":"https://excelsavvy.com/practice/countif#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"How do I use COUNTIF with multiple criteria?","acceptedAnswer":{"@type":"Answer","text":"Use COUNTIFS when all the conditions must be true: =COUNTIFS(B2:B8,\"Copenhagen\",C2:C8,\">=1500\") counts the rows that match both. For \"this or that\", add two COUNTIFs: =COUNTIF(B2:B8,\"Copenhagen\")+ COUNTIF(B2:B8,\"Aarhus\"). Add the results only if no row can match both."}},{"@id":"https://excelsavvy.com/practice/countif#/schema/question/2","@type":"Question","inLanguage":"en-US","name":"Why does COUNTIF return 0 when the value is clearly there?","acceptedAnswer":{"@type":"Answer","text":"Usually the cell holds something slightly different: an extra space at the end, a number stored as text, or a typo in the criterion. Try the TRIM function on the data, or use a wildcard like \"*Copenhagen*\" to catch the extra characters. A criterion longer than 255 characters returns #VALUE!."}},{"@id":"https://excelsavvy.com/practice/countif#/schema/question/3","@type":"Question","inLanguage":"en-US","name":"How do I count dates in a range with COUNTIF?","acceptedAnswer":{"@type":"Answer","text":"Compare against a date and join it with &: =COUNTIF(B2:B20,\">=\"&DATE(2025,1,1)) counts every date from January 1, 2025 on. Use COUNTIFS with a start and an end date for a period. You can also put the date in a cell and write \">=\"&E1."}},{"@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.
