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])

ArgumentWhat it is
logical_expressionThe condition, for example B2>=7.
value_if_trueWhat it returns when the condition holds.
value_if_falseoptionalWhat 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.

Advertising
Loading ad...

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.

Example=IF(B2>=7,"Aprobado","Reprobado")SI = IF

In C2, show "Passed" if the grade is 7 or more and "Failed" otherwise.

C2
ABCD
1StudentGradeResult
2Ana9.5
3Luis6.5
4Sofía7
5Diego5
6Valeria8
7Mateo6.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.