IF function in Excel (2024)

Simple If Examples | And/Or Criteria | Nested If | More about If

The IF function is one of the most used functions in Excel. This page contains many easy to follow IF examples.

Simple If Examples

The IF function checks whether a condition is met, and returns one value if true and another value if false.

1a. For example, take a look at the IF function in cell B2 below.

IF function in Excel (1)

Explanation: if the price is greater than 500, the IF function returns High, else it returns Low.

1b. The following IF function produces the exact same result.

IF function in Excel (2)

Note: you can use the following comparison operators: = (equal to), > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to) and <> (not equal to).

2. Always enclose text in double quotation marks.

IF function in Excel (3)

3a. The formula below calculates the progress between two points in time.

IF function in Excel (4)

3b. You can use the IF function to display an empty string if the end value hasn't been entered yet (see row 5).

IF function in Excel (5)

Explanation: if the end value is not empty (<> means not equal to), the IF function calculates the progress between the start and end value, else it displays an empty string (two double quotes with nothing in between).

And/Or Criteria

Use the IF function in combination with the AND function and the OR function and become an Excel expert.

1. For example, take a look at the IF function in cell D2 below.

IF function in Excel (6)

Explanation: the AND function returns TRUE if the first score is greater than or equal to 60 and the second score is greater than or equal to 90, else it returns FALSE. If TRUE, the IF function returns Pass, if FALSE, the IF function returns Fail.

2. For example, take a look at the IF function in cell D2 below.

IF function in Excel (7)

Explanation: the OR function returns TRUE if at least one score is greater than or equal to 60, else it returns FALSE. If TRUE, the IF function returns Pass, if FALSE, the IF function returns Fail.

3. For example, take a look at the IF function in cell D2 below.

IF function in Excel (8)

Explanation: the AND function above has two arguments separated by a comma (Table, Green or Blue). The AND function returns TRUE if Product equals "Table" and Color equals "Green" or "Blue". If TRUE, the IF function reduces the price by 50%, if FALSE, the IF function reduces the price by 10%.

Nested If

The IF function in Excel can be nested, when you have multiple conditions to meet. The FALSE value is being replaced by another IF function to make a further test.

1. For example, take a look at the nested IF formula in cell C2 below.

IF function in Excel (9)

Explanation: if the score equals 1, the nested IF formula returns Bad, if the score equals 2, the nested IF formula returns Good, if the score equals 3, the nested IF formula returns Excellent, else it returns Not Valid. If you have Excel 2016 or later, simply use the IFS function.

2. For example, take a look at the nested IF formula in cell C2 below.

IF function in Excel (10)

Explanation: if the score is less than 60, the nested IF formula returns F, if the score is greater than or equal to 60 and less than 70, the formula returns D, if the score is greater than or equal to 70 and less than 80, the formula returns C, if the score is greater than or equal to 80 and less than 90, the formula returns B, else it returns A.

More about If

The IF function is a great function. Let's take a look at a few more cool examples.

1. For example, use IF and AND to test if a value is between two numbers.

IF function in Excel (11)

Explanation: the AND function returns TRUE if the person is older than 12 and younger than 20, else it returns FALSE. If TRUE, the IF function returns Yes, if FALSE, the IF function returns No.

2. You can combine IF with AVERAGE, SUM and other Excel functions. The sky is the limit!

IF function in Excel (12)

Explanation: the AND function returns TRUE if the input value is greater than 100 and the average of the values in the named range Data1 is greater than 100, else it returns FALSE. If TRUE, the IF function returns the sum of Data2, if FALSE, the IF function returns 0.

Confused? You can always use the Evaluate Formula tool to step through your IF formula. This Excel tool helps you understand a formula.

3. For example, select cell G3 above.

4. On the Formulas tab, in the Formula Auditing group, click Evaluate Formula.

IF function in Excel (13)

5. Click Evaluate multiple times.

IF function in Excel (14)

Note: try it yourself. Download the Excel file and choose one of the IF formulas explained on this page. You can use this tool to step through all kinds of formulas.

IF function in Excel (2024)

References

Top Articles
Best Sourdough Pizza Crust Recipe On the Planet - Better Baker Club
25 Best-Ever Thanksgiving Recipes
W B Crumel Funeral Home Obituaries
5 Fastest Ways To Become Rich by Investing in the Stock Market
Adventhealth Employee Handbook 2022
Victoria Tortilla & Tamales Factory Menu
Miller Motte College Student Portal
Opsahl Kostel Funeral Home & Crematory Yankton
Tear Of The Kingdom Nsp
Keck Healthstream
Mistar Student Portal Southfield
Getwush Com
Craigslist Farm And Garden Yakima Wa
Dusk Hypixel Skyblock
Ropro Cloud Play
Gay Pnp Zoom Meetings
Courierpress Obit
Gran Turismo Showtimes Near Regal Crocker Park
Nextdoor Myvidster
Busted Newspaper Hart County Ky
Wvtm 13 Schedule
V Pay - Alle Informationen zu dem Zahlungssystem für die Girocard
My Big Fat Greek Wedding 3 Showtimes Near Regal Ukiah
High school football: Photos from the top Week 3 games Friday
My Eschedule Greatpeople Me
Contenidos del nivel A2
Craigslist Apartments For Rent Ozone Park
Kamala Harris, Donald Trump debate prompts major endorsem*nt, Fox News invitation for a 2nd face-off
Mta Bus Forums
EVOLVE: Predicting User Evolution and Network Dynamics in Social Media Using Fine-Tuned GPT-like Model
Education (ED) | Pace University New York
Nephi Veterinarian
Craigslist Philly Free Stuff
Slmd Skincare Appointment
Movierulz.com Kannada 2024 Download: Your Ultimate Guide
Sam's Club Gas Price Spring Hill Fl
Live2.Dentrixascend.com
Unmhealth My Mysecurebill
Importing Songs into Clone Hero: A Comprehensive Tutorial
Roomba I3 Sealing Problem With Clean Base
Spn 102 Fmi 16 Dd15
Nasenspray - Wirkung, Anwendung & Risiken
Mayank Gupta: Latest news and mentions
Phase 3 Cataclysm Classic New Changes, Preparation and Investments Guide
Warrior Badge Ability Wars
North Bay Craigslist Jobs
Chuck Wagon Café, le restaurant de l'hôtel Cheyenne à Disneyland Paris : prix et infos
Tu Pulga Online Utah
Used Vehicles for Sale near Grandville, MI 49418 | U-Haul
El Confidencial Vanitatis
Does Lowes Take Ebt
How a fringe online claim about immigrants eating pets made its way to the debate stage
Latest Posts
Article information

Author: Neely Ledner

Last Updated:

Views: 6150

Rating: 4.1 / 5 (42 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.