Excel IF function
Returns one value when a condition is true and another when it is false. It is the basis of logic in Excel. In Spanish Excel it is called SI.
Syntax
English Excel
=IF(logical_test, value_if_true, [value_if_false])
Spanish Excel (Mexico)
=SI(prueba_lógica, valor_si_verdadero, [valor_si_falso])
Spanish Excel (Spain, Latin America)
=SI(prueba_lógica; valor_si_verdadero; [valor_si_falso])
| Argument | What it is |
|---|---|
| logical_test | The condition, for example B2>=7. |
| value_if_true | What it returns when the test is true. |
| value_if_falseoptional | What it returns when the test is false. |
Example
IF(test, value_if_true, value_if_false) returns one value or another depending on a condition. Conditions use = <> < > <= >=. Text goes in quotes.
=IF(B2>=7,"Passed","Failed")
Common mistake
Text goes in quotes ("Passed"); numbers and references do not. For more than two outcomes, nest another IF.
About Ads
This site uses Google AdSense to display ads. These ads help us keep WebHerramientas completely free. Ads are managed by Google and meet strict security and privacy standards.
Ads help us keep WebHerramientas free for everyone
Practice IF
Type the formula in the sheet and check it instantly. Spanish or English function names both work. See all lessons
IF
IF(test, value_if_true, value_if_false) returns one value or another depending on a condition. Conditions use = <> < > <= >=. Text goes in quotes.
In C2, show "Passed" if the grade is 7 or more and "Failed" otherwise.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Student | Grade | Result | |
| 2 | Ana | 9.5 | ||
| 3 | Luis | 6.5 | ||
| 4 | Sofía | 7 | ||
| 5 | Diego | 5 | ||
| 6 | Valeria | 8 | ||
| 7 | Mateo | 6.9 | ||
| 8 |
Tip: while typing, click a cell or drag across several to insert their reference.
Frequently asked questions
- What is IF called in Spanish?
- In Spanish Excel it is SI. The formula =IF(B2>=7,"Passed","Failed") is written =SI(B2>=7;"Aprobado";"Reprobado") (or with commas in Mexico).
- Why does IF use semicolons in some Excel versions?
- It depends on regional settings. Where the comma is the decimal mark (Spain, much of South America), Excel separates arguments with semicolons. English Excel and Mexican Spanish Excel use commas.
- What is the most common IF mistake?
- Text goes in quotes ("Passed"); numbers and references do not. For more than two outcomes, nest another IF.