EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Certification Courses
  • 120+ Courses All in One Bundle
  • Login
Home Excel Excel Resources Logical Functions in Excel Tutorial Excel IF Function
Secondary Sidebar
Excel Functions
  • Logical Functions in Excel
    • Excel IF AND Function
    • IFERROR Formula in Excel
    • SUMIF with Multiple Criteria
    • Excel SUMIFS with Dates
    • FALSE Function in Excel
    • Excel IF Function
    • Excel Logical Test
    • Excel XOR Function
    • Logical Functions Excel
    • IFERROR Excel Function
    • TRUE Function in Excel
    • OR Function in Excel
    • NOT in Excel
    • AND Function in Excel
  • Excel Functions (12+)
  • Excel Tools (114+)
  • Financial Functions in Excel (17+)
  • Lookup and Reference Functions in Excel (35+)
  • Maths Function in Excel (47+)
  • TEXT and String Functions in Excel (26+)
  • Date and Time Function in Excel (24+)
  • Statistical Functions in Excel (59+)
  • Information Functions in Excel (4+)
  • Excel Charts (56+)
  • Excel Tips (222+)
  • Workplace Productivity (4+)
  • Microsoft Office Tools (15+)
  • Excel Formula and Functions (22+)
  • MS Excel Shortcuts (4+)
Excel Functions Courses
  • Online EXCEL ADVANCED COURSE
  • Excel Data Analysis Certification
  • Excel for Marketing Certification

Excel IF Function

By Jeevan A YJeevan A Y

IF Function in Excel

Excel IF Function (Table of Contents)

  • IF Function in Excel
  • How to Use IF Function in Excel?

IF Function in Excel

The IF Function is the most popular function in Excel, and it allows you to make logical comparisons between a value and what you expect the output. We all know Excel is used for different types of reports. For example, some reports may contain huge data with lots of fields in them. But it can happen that the report may not give you the desired result based on certain fields in the report. This is where Conditional formulas are used. If you need an outcome based on the criteria, which depends on a field available in the report, you can use conditional formulas of excel. There are many conditional formulas available in Excel. e.g., IF, OR, AND etc., but we will cover the IF Function here. The IF Function is an inbuilt function in Excel which is categorized as a Logical Function.

How to Use IF Function in Excel?

IF Function can be used as a worksheet function in Excel, which means it can be entered as a part of a formula in the Worksheet cell. IF Function gives the outcome based on the conditional criteria for a field.

Syntax for the IF Function in Excel is:

Start Your Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

IF (Condition, Value_ if_ true, [ Value _ if _false])

IF Function syntax

Example #1

Let’s understand How to use the IF Function in Excel using some examples.

All in One Excel VBA Bundle(120+ Courses, 30+ Projects)
Basic ExcelAdvanced ExcelVBA & MacrosExcel Dashboards
Pivot TablesStatistical FunctionsFinancial FunctionsCharts & Graphs
Price
View Courses
120+ Online Courses | 30+ Projects | 500+ Hours | Verifiable Certificates | Lifetime Access
4.9 (64,596 ratings)
You can download this IF Function Excel Template here – IF Function Excel Template

Below is the data with Sales Target and Actual Sales of the respective employees.

If Function in Excel Example 1 Excel Data

There are 5 people in your team in Column A, and you have given them the sales target for a month in Column B and their actual sales done is given in Column C, so with the given data, you need to evaluate which person has achieved the target and who has not achieved the Target in Column D.

Now we will input the formula for Employee Shikha in Column D2- =IF(C2>=B2,”Target met “,”Target not Met”).

Let’s break the formula into three parts to get a better understanding.

  • Condition
  • Value IF TRUE
  • Value IF FALSE

Now in our example:

Condition – C2>=B2

Value IF True – Target Met

Value IF False – Target Not Met

IF Function Example 1-2

By dragging the C2 cell till the C6 cell, we will get the result for all employees.

IF Function Example 1-3

So, you can see that based on the data in Column B and C, we got to know which employee has MET TARGET and which has NOT MET TARGET.

Nested IF Statements

The IF Function can be “Nested”, which refers to a formula where at least one IF Function is nested inside another to test for more than one condition, which in return give more possible results. So, in “nested IF Statements,” you must be very careful because each IF Statement needs to be nested inside another, so the logic is correct. You can refer to the below example, which will show you the “Nested IF” Formula usage.

Example #2

In this example, we have 5 students and their respective marks in 5 subjects, giving us the Total marks for each student and their % of Marks.

 Example 2 Excel Data

Now to know each student’s grades, we will use the IF Function by using their % marks. We want to give the students 3 Grades-A, B & C.

We will use Formula in I2 Column- =IF(H2>=80,” A”, IF(H2>=70,” B”, IF(H2>=60, “C”))).

Nested If Function Example 2-2

 Example 2 Final Result

You can input the IF Formula in I2 Column and can autofill till I6. So, this is how we got the grades of the students by using the IF Function.

Example #3

We have the data of some comedians who came for shopping, so here in the below example, we will show you that IF their total bill is more than 5000, they will get a 10% Discount. Let’s go through the example, which will give a clear understanding of the use of the IF function and Nested IF.

Example 3 Excel Data

Now in our example, we will first show the use of the IF Function and then the Nested IF function.

Condition- C2>=5000

Value IF True – 10%

Value IF False – 0

Now we will input the IF Function Formula in E2 column, Syntax- =IF(C2>5000,”10%”,”0″). It will show who will get a 10% Discount and who will not.

Example 3-2

You can autofill the rest of the E column till we have data.

 Example 3-3

Now we will show you how can we use the Nested If Statement for the same example. In the Nested IF formula, at least one IF Function is nested inside another to test for more than one condition.

Here the Conditions are:

  • Customer Bill>20000, “A.”
  • Customer Bill>10000, “B.”
  • Customer Bill <10000, “C.”

The formula for Nested IF in our example is as follows:

=IF(C2>20000,”A”, IF(C2>10000,”B”,”C”)).

Example 3-4

By dragging the cell F2 till cell F9, we will get the result for all the customers.

 Example 3 Final Result

In the above example, the customer’s bill> 20000 will be category A, the customer’s bill>10000; it will be category B and the customer’s bill<10000, it will be category C.

Example #4

In this example, an Employee has made the budget of the expenses for his Onshore Trip. In the below screenshot, there is his budgeted data and the Actual amount spent by him.

Now in our example:

Example 4 Excel data

Condition- C2>=B2

Value IF True- Over Budget

Value IF False – In Budget

Now we will input the IF Function Formula in D2 Column to know whether his expenses are in his Budget or Overbudget.

Formula will be- =IF(C2>=B2,”Over Budget “,”In Budget”).

IF Function Example 4-1

 Example 4 Final Result

Things to Remember about IF Function in Excel

  • IF Function is used to test or evaluate certain conditions and then give results differently depending on that condition.
  • Up to 64 IF Functions can be Nested when you are using the Nested Formula.
  • If any arguments to the IF are supplied as an array, the IF function will evaluate every element of that array.
  • When you apply the IF Formula and use text values in the formula, you need to enclose the text in double quotes (e.g. “Text”).
  • The IF Function can be combined with Logical functions like AND & OR.

Recommended Articles

This has been a guide to IF Function in Excel. Here we discussed how to use the IF Function in Excel along with practical examples and a downloadable excel template. You can also go through our other suggested articles to learn more –

  1. COUNTIF Excel Function
  2. Nested IF Formula in Excel
  3. VBA IF Statements
  4. SUMIF Formula in Excel
Popular Course in this category
Excel Advanced Training (16 Courses, 23+ Projects)
  16 Online Courses |  23 Hands-on Projects |  140+ Hours |  Verifiable Certificate of Completion
4.8
Price

View Course

Related Courses

Excel Data Analysis Training (17 Courses, 8+ Projects)4.9
Excel for Marketing Training (8 Courses, 13+ Projects)4.8
7 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Excel Charts
  • Excel Tips
  • All Tutorials
Certification Courses
  • All Courses
  • Excel VBA Course - All in One Bundle
  • VBA Course
  • Excel Data Analysis Course
  • Excel for Marketing Course
  • Excel for Finance Course
  • Excel for HR Training

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

Download IF Function Excel Template

EDUCBA

Download IF Function Excel Template

EDUCBA

डाउनलोड IF Function Excel Template

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more