Back to functions
Logical2026-03-1819 related articles

IF Function in Excel

Test a condition and return one result for TRUE and another for FALSE.

Syntax

IF(logical_test, value_if_true, [value_if_false])

Arguments

logical_test

Required

The comparison or expression that Excel evaluates as TRUE or FALSE.

value_if_true

Required

The value or formula returned when the test is TRUE.

value_if_false

Optional

The value or formula returned when the test is FALSE.

What it returns

Returns one of two results based on whether the logical test passes.

What IF does

IF is Excel's core decision-making function. It evaluates a condition and then branches to one result when the condition is true and another when it is false.

That makes it useful for pass/fail labels, clean output, error prevention, and business rules that depend on thresholds.

Practical examples

Return a label based on a threshold

=IF(B2>=70,"Pass","Review")

This is the simplest IF pattern: compare a value, then return one of two labels.

Avoid division by zero

=IF(C2=0,"",B2/C2)

Here IF prevents an avoidable error and keeps the report readable when there is no valid denominator.

Common mistakes and notes

Forgetting text quotes

Text results such as "Pass" or "Late" need quotation marks. Numeric results do not.

Over-nesting

Long chains of nested IF formulas become hard to read and hard to debug. When a worksheet depends on many branches, consider lookup tables or functions such as SUMIFS, VLOOKUP, or INDEX plus MATCH.

Leaving the false branch undefined

If you omit value_if_false, Excel returns FALSE. Sometimes that is useful, but on reports it often looks like a mistake.

Related functions

Related articles

Deep dives, troubleshooting guides, and practical examples that use IF.

BeginnerFormulas
2026-10-02

How to Split First and Last Names in Excel

Split names into columns with TEXTSPLIT, TEXTBEFORE, TEXTAFTER, or Text to Columns. Handle extra spaces, single names, and middle names....

#Excel#text functions#data cleanup
8 min read
Read Article
FormulasBeginner
2026-09-20

Excel IF Cell Contains Text: Formulas and Examples

Use IF with SEARCH, FIND, or COUNTIF to test whether an Excel cell contains text, with case-sensitive, multi-word, and blank-input examples....

#Excel#IF function#text formulas
9 min read
Read Article
FormulasBeginner
2026-09-16

Weighted Average in Excel: Formula and Examples

Calculate a weighted average in Excel with SUMPRODUCT and SUM. Follow price, score, and percentage examples, and handle zero weights and missing values....

#weighted average#SUMPRODUCT#averages
7 min read
Read Article
Beginner
2026-08-12

How to Insert a Check Mark in Excel (5 Easy Methods)

Insert an Excel check mark with copy and paste, Symbol, a Windows shortcut, formulas, or conditional formatting. Learn when to use a checkbox instead....

#formatting#symbols#productivity
9 min read
Read Article
FormulasBeginner
2026-06-08

Compare Two Columns in Excel

Learn how to compare two columns in Excel for matches, differences, duplicates, missing values, and case-sensitive text....

#formulas#data cleanup#lookup
7 min read
Read Article
FormulasTroubleshooting
2026-05-19

How to Find and Fix Circular References in Excel

Learn how to find a circular reference in Excel, trace the formula loop, fix common circular reference errors, and handle intentional iterative formulas....

#formulas#troubleshooting#circular references
9 min read
Read Article
FormulasBeginner
2026-04-08

How to Calculate Percentage Change in Excel

Learn the percentage change formula in Excel, including examples for increases, decreases, percentage formatting, and avoiding divide-by-zero errors....

#percentages#formulas#math
7 min read
Read Article
AI in ExcelAdvanced
2026-03-18

The Karpathy Loop for Excel: How Autoresearch Changes the Way We Optimize Spreadsheets

Learn how Karpathy's autoresearch pattern — the AI experiment loop that ran 700 tests in two days — applies to Excel formula optimization, VBA macros, and AI-assisted spreadsheet workflows....

#ai#automation#formulas#optimization
9 min read
Read Article
AI in ExcelFormulas
2026-01-08

How to Use AI to Explain Excel Formulas Step by Step

Learn how to use AI to explain Excel formulas step by step, including how to verify the explanation and catch what the model still gets wrong....

#ai#formulas#troubleshooting
3 min read
Read Article
AI in ExcelFormulas
2025-12-18

Best AI for Excel Formulas: Copilot vs ChatGPT vs Claude

Compare Copilot, ChatGPT, and Claude for Excel formulas using the same prompt, the same workbook task, and the same verification standard....

#ai#formulas#comparison
4 min read
Read Article
AI in ExcelAdvanced
2025-11-14

AI in Excel: Practical Guide to Copilot, ChatGPT, Claude, and Gemini

Learn how to use AI in Excel with Copilot, ChatGPT, Claude, and Gemini. Compare strengths, limitations, use cases, and how to verify AI-generated formulas, analysis, and automation....

#ai#data-analysis#automation
16 min read
Read Article
Time and Date
2024-01-02

How to Insert a Timestamp in Excel: Static, Dynamic, and Automatic Methods

Insert a fixed timestamp with Excel shortcuts, show the current time with NOW, or record data entry with an iterative formula or VBA....

#date#shortcuts#time#timestamp
11 min read
Read Article
BeginnerFeatures
2018-05-23

5 New and Creative Ways To Utilize Excel

Excel is a program that is beneficial to anyone who wants to organize the utility bills or for professionals who need to stay organized at the office. To most Excel users, it can seem like a pretty cut and dry program. W...

8 min read
Read Article
BeginnerFormulas
2018-04-17

How to Use the AVERAGE Function in Excel

To figure out the average of a group of numbers, makes it easier for you to analyze important data. Learn how to use the average function in Excel right here....

#math#functions
6 min read
Read Article
FormattingFormulas
2018-03-27

How to Use the SUMIF and SUMIFS Functions in Excel

Lessen the time it takes to compute complex equations with the SUMIF and SUMIFS functions on MS Excel. This update may be just what you've been waiting for. Follow this in-depth, easy-to-follow guide to get started...

#criteria#formulas#functions#math
5 min read
Read Article
BeginnerFormulas
2010-12-15

Logical Operations in Excel

Logical operations in Excel on four TRUE/FALSE outcomes of A an B. Then ADD, MULTIPLY, and use functions AND, OR, NOT, NAND, NOR, & equals comparison....

3 min read
Read Article
FormulasIntermediate
2010-11-20

How to Calculate Letter Grades in Excel (IF and VLOOKUP)

Turn numeric scores into letter grades in Excel with nested IF, a VLOOKUP grading table, or a named array. Handle blanks and decimal grade boundaries....

#education
8 min read
Read Article
FormulasIntermediate
2010-11-18

Nested IF Functions in Excel

Nested IF Functions means having at least one IF Function contained within another IF Function, which can get complicated. Use a binary outcome chart....

3 min read
Read Article
BeginnerFormulas
2010-11-16

The IF Function in Excel

The IF Function has three arguments. The first is required, the last two optional. Comparison calculation operators and example IF Functions shown....

3 min read
Read Article

Official documentation