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

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

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 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.