IF and COUNTIF practice: decisions and counting
For anyone who needs a sheet to decide something on every row: pass or retake, in date or due, Green, Amber or Red. You'll write IF, AND and OR, turn marks into grades with IFS, and count with COUNTIF and COUNTIFS. The project is a community centre's training tracker for 30 staff, ready for an inspection, with counts and percentages for each team.
10 lessons45 exercises30 Check questions1 free lessona project in Excel4 suggested CPD hours
These are scores from a compliance test, and the pass mark is in H1. In C2, show Pass if the score is at least the pass mark, otherwise Fail.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Employee | Score | Result | Refresher? | Marks to pass | Pass mark | 40 | |
| 2 | Grace | 52 | ||||||
| 3 | Tom | 38 | ||||||
| 4 | Priya | 61 | ||||||
| 5 | Marek | 40 | ||||||
| 6 | Nia | 27 | ||||||
| 7 | Ollie | 45 | ||||||
| 8 | Lucy | 30 | ||||||
| 9 | Hamza | 70 | ||||||
| 10 | Rachel | 19 | ||||||
| 11 | Sunil | 48 |
The lessons
Each lesson starts with a short worked example, then exercises on real-looking data, marked the moment you press Check, with hints when you need them. It ends with a Check: new questions on fresh data, with no hints. Pass it and the lesson is marked Secure.
- IF Free
Making a decision on every row · 4 exercises · a Check of 3 questions · guide: The IF function - AND and OR Pro
Combining conditions · 4 exercises · a Check of 3 questions · guide: AND and OR in Excel - Grades with IFS and IFERROR Pro
Nested IF, IFS, IFERROR · 4 exercises · a Check of 3 questions · guide: IFERROR - COUNTIF and COUNTIFS Pro
Counting rows that match · 4 exercises · a Check of 3 questions · guide: COUNTIF and COUNTIFS - Criteria from cells, and wildcards Pro
">="&H1, "*"&H1&"*", "<>" · 5 exercises · a Check of 3 questions - Review: counting Pro
COUNT, COUNTA, COUNTIF, COUNTIFS, COUNTBLANK · 6 exercises · a Check of 3 questions
Extra practice
Useful, but not needed for the project.
- TRUE, FALSE and logical tests Pro
comparisons, NOT, AND, XOR · 5 exercises · a Check of 3 questions - Matching codes with SWITCH Pro
SWITCH, a default result, WEEKDAY · 4 exercises · a Check of 3 questions - Checking cells with IS functions Pro
ISBLANK, ISNUMBER, ISTEXT, ISERROR, ISEVEN · 5 exercises · a Check of 3 questions - Counting blanks and entries Pro
COUNT, COUNTA, COUNTBLANK, COUNTIF "*" · 4 exercises · a Check of 3 questions · guide: Count cells with text, numbers or blanks in Excel
The project in Excel: Staff training tracker
A community centre has an inspection on 1 December. Find out who has passed safeguarding, whose fire safety training is out of date, and how each team is doing.
What you'll build:
- Pass or Retake, and In date or Due, for 30 staff
- A Green, Amber or Red status for each person
- Counts and percentages for each team
- "No staff" instead of an error for an empty team
Download the workbook and do the job in Excel. A Check sheet in the workbook ticks off each task as you get it right, and the model answers are there to compare with when you've finished. You'll need Excel 2019 or later, or Excel for the web, which is free with a Microsoft account.
Counts towards a certificate
Unit 3 is part of the Excel Foundations certificate of achievement (Units 1 to 3, 9 hours of suggested CPD). To earn it, pass the Check in every lesson of those units while signed in (reviews and extra practice aren't needed), and finish each unit's project in Excel. Our server checks the work itself. Certificates come with Pro: see how they work.
Online practice and assessment, completed without supervision. Confident Cells is independent and isn’t connected with Microsoft. This is not a formal qualification.
Guides for this topic
- AND and OR in Excel: two conditions in one IFHow AND and OR test two or more things at once, how to put them inside IF, and the mistakes that give #VALUE! or always No. With a free practice box.
- Count cells with text, numbers or blanks in ExcelHow to count cells with text, numbers, anything or nothing in Excel with COUNTA, COUNT, COUNTIF and COUNTBLANK, with worked numbers and a sheet to practise on.
- COUNTIF and COUNTIFS: counting rows that matchHow COUNTIF counts the cells that match a condition, and COUNTIFS several conditions, with a worked example, common mistakes and a sheet to practise on.
- IFERROR: showing a message instead of an errorHow IFERROR shows a blank, a zero or a message instead of #DIV/0! or #N/A, when to use it and when not to, with a worked example and a sheet to practise on.
- MO-200 Excel Associate (Excel 2019): practice and checklistPractise for MO-200, the Excel Associate exam for Excel 2019: a free 5-task taster marked as you go, and a checklist of every exam task that ticks itself off.
- MO-210 Excel Associate (Microsoft 365): practice and checklistPractise for MO-210, the Excel Associate exam for Microsoft 365: a free 5-task taster marked as you go, and a checklist of every exam task that ticks itself off.
- The IF function: a simple worked exampleHow the IF function shows one result when something is true and another when it isn't, with a worked example, the common mistakes and a sheet to practise on.
Questions
IF or IFS?
IF gives one of two results. For three or more, such as Green, Amber and Red, IFS is easier to read than an IF inside an IF. IFS is in Excel 2019 and later, Microsoft 365 and Google Sheets. Older Excel shows #NAME?, so put one IF inside another there.
COUNTIF or COUNTIFS?
COUNTIF takes one condition, such as how many staff work in the kitchen. COUNTIFS takes pairs of a range and a condition, so it can count how many kitchen staff are also out of date. COUNTIFS with one pair does the same job as COUNTIF. See COUNTIF with a worked example.