Skip to content
GridBelt
  • Excel Test
  • Practice
  • Programs
  • Pricing
Sign in
Start the free test
  • Excel Test
  • Practice
  • Programs
  • Pricing
Sign inCreate account
Start the free test
GridBelt

Practice Excel in your browser.

Excel Test

  • Level 1: Beginner
  • Level 2: Intermediate
  • Level 3: Expert
  • Excel test in 7 days
  • Leaderboard
  • Excel test for interview
  • Indeed Excel assessment

Practice

  • All exercises
  • Programs
  • For beginners

Guides

  • Excel formulas
  • Excel shortcuts

Company

  • About
  • Pricing
  • How we grade

© GridBelt. All rights reserved.

  • Privacy Policy
  • Terms of Use
  • Refund Policy

Excel is a trademark of Microsoft Corporation. Indeed, TestGorilla, SHL and other marks are the property of their owners. GridBelt is an independent practice site and is not affiliated with, endorsed by or sponsored by Microsoft, TestGorilla, SHL or Indeed.

  1. Practice
  2. /
  3. COUNTIF and COUNTIFS

COUNTIF wildcard practice: count .edu addresses in 120 contacts

  • Beginner
  • ~4 min
  • COUNTIF and COUNTIFS

120 people signed up for a data-literacy conference. The organiser offers an academic rate to anyone registering with a university address, and finance wants to know how many sign-ups qualify before the invoices go out. A qualifying address ends in .edu — the list also contains .edu.au addresses from Australian institutions and company domains with "edu" inside the name, which do not qualify. Count the .edu addresses with one formula in H2.

What you need to do

  1. 1Click H2. The email addresses are in D2:D121.
  2. 2Write COUNTIF with the range first and the criterion second. The criterion is text in quotes: an asterisk stands for any number of characters, so "*.edu" means "anything, then .edu at the very end".
  3. 3Press Enter. The count is case-insensitive, so addresses written in upper case (…@LAKESIDE.EDU) are included automatically.
  4. 4Sanity-check against the list: the 4 addresses ending in .edu.au must not be counted. Then click Check (Ctrl+Enter / ⌘+Return).

Answer cells

Feedback

Type your formula in the grid, press Enter, then Check. We grade the value in each answer cell and the formula behind it.

Tasks

  1. Not checkedIn H2, use COUNTIF with a wildcard to count how many email addresses in D2:D121 end in ".edu".

Desktop recommended for spreadsheet tasks. The sheet scrolls inside this box.

StartInsertFormulasDataView
A1fxPreparing your workbook…
A
B
C
D
E
F
G
H
I
J
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Sheet1

Enter your formula in the sheet, then check.

About this exercise

A 120-row dataset on one sheet, one answer cell, about 4 minutes. Graded in your browser: the value and the formula behind it, with feedback that names the fix.

How to solve it

  • H2=COUNTIF(D2:D121,"*.edu")

COUNTIF accepts wildcards in text criteria: * stands for any sequence of characters (including none) and ? for exactly one character. "*.edu" therefore matches every address that ends in .edu, whatever comes before, and the comparison ignores case — 38 rows here. Because nothing may follow the pattern, an address ending in .edu.au is not matched, which is exactly the distinction finance needs.

Pitfall 1: "*edu*" matches "edu" anywhere — it returns 45 on this list by also counting .edu.au addresses and domains such as educonsult.com and medu.org. Pitfall 2: "*.edu" also matches a bare value ".edu" or "x.edu" with no @; if the data can contain junk, "*@*.edu" is the stricter pattern. Pitfall 3: to match a literal asterisk or question mark, escape it with a tilde ("~*"); and wildcards only work on text — a numeric column needs its own criteria (">500"). Alternatives: SUMPRODUCT(--(RIGHT(D2:D121,4)=".edu")) tests the last four characters without wildcards; COUNTIFS(D2:D121,"*.edu") is the same count with room for a second condition (role, country). In Excel 365, =ROWS(FILTER(D2:D121,RIGHT(D2:D121,4)=".edu")) lists and counts in one go; COUNTIF remains the fastest and most portable version.

Other ways that work

  • =COUNTIF(D2:D121,"*@*.edu") — stricter: requires an @ before the domain
  • =COUNTIFS(D2:D121,"*.edu") — the same count written with COUNTIFS (not accepted here, because this task asks for COUNTIF)
  • =SUMPRODUCT(--(RIGHT(D2:D121,4)=".edu")) — compares the last four characters instead of using a wildcard

Common mistakes

Writing the criterion as "*edu*" or "edu": the first over-counts (45 instead of 38) because it also matches .edu.au and company names containing "edu"; the second counts nothing, because COUNTIF without wildcards needs the whole cell to equal the text.

How we grade

Any formula that produces the right result is accepted, unless the task names a function: then another function earns half credit. We compare values with a small tolerance and ignore case and spaces in text. A correct number typed by hand instead of a formula earns half credit. Multi-cell tasks earn full credit at 100% of cells, half credit from 50%. Where it matters, we also change an input cell on a copy of your sheet and check that your formula follows.

Answers computed with Excel 365 rules and checked in our grading engine on November 16, 2026. Author: GridBelt team.

Related exercises

  • Orders per status with COUNTIFBeginner, ~5 min
  • Orders between two datesIntermediate, ~6 min
  • Flag rows with missing dataIntermediate, ~5 min

Function reference

Official documentation

Next exercise

Orders per region and month with COUNTIFS