IF function
IF evaluates a condition and returns the value assigned to either the true or false result.
Logical
Where can you use it?
Teams building reports and business rules. Adapt the example’s decision rule when you need to test a condition or display different results based on it.
Scenario in the workbook
Mark a record ready when the amount reaches the target. Equality passes.
A worked example from the workbook
| Row | A | B |
|---|---|---|
| 6 | Value | Comparison |
| 7 | 10 | 2 |
| 8 | 5 | 5 |
| 9 | 1 | 2 |
=IF(A7>=B7,"Ready","Open")Expected resultReady
See the inputs and instructions for all 3 examplesCopyable formulas
=IF(B2="","",IF(B2>=8,"Complete","Short"))=EĞER(B2="";"";EĞER(B2>=8;"Tam";"Eksik"))Sample data
Enter the headers and sample records in A1:B4.
| Employee | Hours |
|---|---|
| Deniz | 8 |
| Ada | 7.5 |
| Ege |
Fill down through C4.
Enter the formula in C2.
To try the Turkish formula, use the sample data on the Turkish page.
Expected result
Complete, Short, blank
How it works
The outer check leaves the output blank for a blank input. The inner check applies the eight-hour threshold. A numeric zero is an entered value and returns Short. Enter hours as numbers.
Syntax
IF(logical_test, value_if_true, [value_if_false])
Compatibility
Excel for Microsoft 365 and Excel 2016, 2019, 2021, and 2024.
Related pages
Worked examples
Mark a record ready when the amount reaches the target. Equality passes.
Open the English sheet. Inputs begin at A6. F7:F9 show the live results and G7:G9 show the original results for comparison.
| Row | A | B |
|---|---|---|
| 6 | Value | Comparison |
| 7 | 10 | 2 |
| 8 | 5 | 5 |
| 9 | 1 | 2 |
| Case | Formula | Expected result |
|---|---|---|
| Record 1 | =IF(A7>=B7,"Ready","Open") |
Ready |
| Record 2 | =IF(A8>=B8,"Ready","Open") |
Ready |
| Record 3 | =IF(A9>=B9,"Ready","Open") |
Open |