Google Sheets IF function
Returns one value or another depending on a condition. In Spanish Sheets it is called SI.
Syntax
English Sheets
=IF(logical_expression, value_if_true, [value_if_false])
Spanish Sheets (Mexico locale)
=SI(expresión_lógica, valor_si_es_verdadero, [valor_si_es_falso])
Spanish Sheets (Spain, Latin America)
=SI(expresión_lógica; valor_si_es_verdadero; [valor_si_es_falso])
| Argument | What it is |
|---|---|
| logical_expression | The condition, for example B2>=7. |
| value_if_true | What it returns when the condition holds. |
| value_if_falseoptional | What it returns otherwise. |
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 and must match exactly. Inside ARRAYFORMULA, IF takes ranges and classifies a whole column with one formula.
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 Google Sheets it is SI. The formula =IF(B2>=7,"Passed","Failed") is written =SI(B2>=7;"Aprobado";"Reprobado") (or with commas under a Mexico locale).
- Why does IF use semicolons in some spreadsheets?
- It depends on each spreadsheet's locale, under File > Settings. Where the comma is the decimal mark (Spain, much of South America), arguments are separated by semicolons. Mexico and United States locales use commas.
- What is the most common IF mistake?
- Text goes in quotes and must match exactly. Inside ARRAYFORMULA, IF takes ranges and classifies a whole column with one formula.