Confident Cells

The IF function: a simple worked example

20 November 2026 · 2 min read

IF checks whether something is true, then shows one result if it is and a different result if it isn't. For example: if someone has done at least 12 hours of training, show Yes, otherwise show No.

A worked example

Everyone in a team needs at least 12 hours of training this year. Here's where they are so far.

AB
1EmployeeHours
2Grace14
3Tom9
4Tanya12

Go down the list and ask the same question each time: is the number of hours 12 or more?

IF asks that question on every row for you.

The formula

=IF(B2>=12,"Yes","No")
ABC
1EmployeeHoursMet target?
2Grace14Yes
3Tom9No
4Tanya12Yes
C2 holds =IF(B2>=12,"Yes","No"), copied down to C4.

The two results don't have to be words. They can be numbers or other formulas, such as a bonus only for people over target: =IF(B2>=12,50,0). Use "" to leave the cell looking blank.

The comparisons you can use

TypeMeansExample
=equal toC2="Sales"
<>not equal toC2<>"Sales"
>more thanB2>12
>=at least (more than or equal to)B2>=12
<less thanB2<12
<=at most (less than or equal to)B2<=12

Read the wording carefully. "More than 12" is >12, so someone on exactly 12 gets No. "At least 12" is >=12, so they get Yes.

Common mistakes

Text without quotes

Words in a formula need double quotes: "Yes", not Yes. Without them Excel looks for something called Yes, can't find it, and shows #NAME?.

Numbers in quotes

The opposite mistake: =IF(B2>="12","Yes","No"). "12" in quotes is text, not a number, and Excel never counts a number as bigger than text, so everyone gets No. Leave numbers without quotes.

Typing ≥ or ≤

Excel doesn't understand the ≥ and ≤ symbols. Type two characters instead: >= and <=.

Typing the target into every formula

If the target might change, put it in a cell (say F1) and refer to that: =IF(B2>=$F$1,"Yes","No"). Then you change one cell, not every formula. The $ signs keep the reference on F1 when you copy the formula down.

More than two results

For three or more results, such as Gold, Silver and Bronze, use IFS. It checks each question in order and stops at the first one that's true, so put the highest band first:

=IFS(B2>=20,"Gold",B2>=12,"Silver",TRUE,"Bronze")

The last pair, TRUE,"Bronze", catches everyone else. IFS is in Excel 2019 onwards and Google Sheets. In older versions, put one IF inside another: =IF(B2>=20,"Gold",IF(B2>=12,"Silver","Bronze")).

Try it now

Your turn

The training target is at least 12 hours. In C2, show Yes if the employee has met it and No if they haven't. Your formula will be copied down to C8.

ABC
1EmployeeHoursMet target?
2Priya12
3Grace14
4Tom9
5Marek21
6Nia11
7Ollie16
8Lucy3