×

Excel IF() Function

Excel IF() Function: The IF() function in excel checks whether a condition is true or not and returns one value if the condition is TRUE and another value if it's FALSE.

Syntax

if(Logical_Test, [value_if_true], [value_if_false])

Parameter

Logical_Test (required)- This parameter represents the condition which you want to check (greater than, less than or equal to signs can be used for numbers). When you want to evaluate a condition based on text value, then use double quotes ('') with equal to signs.

value_if_true (optional)- This parameter represents the logical test value, and if it holds the value, then excel will return this value.

value_if_false (optional)- If the logical test does not hold, then excel will return this value.

Category

Logical

Return

The function returns one value if the condition is TRUE and another value if it's FALSE.

Example 1

Objective: Using IF formula to identify if a student has passed an exam or not

Student Name Marks Pass or Fail Formula
Mukta 80 Pass  =IF(B2>=30,"Pass","Fail")
Arvind 60 Pass  =IF(B3>=30,"Pass","Fail")
Jyotsna 29 Fail  =IF(B4>=30,"Pass","Fail")
Amar 11 Fail  =IF(B5>=30,"Pass","Fail")

Example 2

Objective: Using the IF Function, check whether the student has passed or not. If the student has failed in 1 of the 2 subjects, then the student will be considered as Failed.

Student Name Subject 1 Subject 2 Overall Result Formula
Reeta PASS PASS PASS  =IF(AND(B26="PASS",C26="PASS"),"PASS","FAIL")
Sweta PASS FAIL FAIL  =IF(AND(B27="PASS",C27="PASS"),"PASS","FAIL")
Baani FAIL PASS FAIL  =IF(AND(B28="PASS",C28="PASS"),"PASS","FAIL")
Aditya PASS PASS PASS  =IF(AND(B29="PASS",C29="PASS"),"PASS","FAIL")

Related Topics

Excel HLOOKUP() Function

Excel HLOOKUP() Function The HLOOKUP() function in excel is used to search a value in the topmost row of a table and then return a corresponding value in the same column for the specified...

2 minutes read.

Averageif Function in Excel

Average If in HTML In Mathematics, Average function is used to find the arithmetic mean of the given data. It is defined as the dividing the sum total of given data...

7 minutes read.

Excel COUNT() Function

Excel COUNT() Function The COUNT() function counts the number of cells in a range that contain numbers. Syntax COUNT([value1], [value [2], ...) Parameter value1(required)- This parameter represents the first cell in the range. value2, …(optional)- It represents the...

1 minute read.

How to make use of the Wildcard in Excel

In this modern world, it is known that the wildcard characters in Microsoft Excel are considered to be the most essential and unrated features of Microsoft Excel. Besides all these,...

8 minutes read.

Formatting in Excel

Formatting in Excel Formatting in Excel is used to alter and change the appearance of your data in a standardized form. It also helps you to give a professional look to your reports, worksheets,...

7 minutes read.

Count Cells with Text in Excel

Excel spreadsheets are widely used in many fields to store and analyze data. Usually, the cells present in excel are a combination of numbers and text. To perform the calculation...

3 minutes read.

Pivots Table in Excel

What is a Pivot? A pivot table is a tool to create summary reports from data-sets irrespective of their sizes but is helpful even if the data is more than just...

5 minutes read.

Excel Function and Formulas

Excel Today() Function The today() function returns the serial number of today’s date as per system number of today’s date as per system’s regional settings. Syntax Today() Parameter NA Category Date & Time Returns This function returns today's date...

4 minutes read.

Excel MIN() Function

Excel MIN() Function The MIN() function in excel returns the smallest or minimum value from the provided numbers, named range or array. It ignores logical values and text. Syntax MIN(Number1,Number2, ...) Parameter Number1(required)- This parameter represents the...

1 minute read.

Excel TIME() Function

Excel TIME() Function The TIME() function in excel returns the serial number of a particular time. Syntax TIME(HOUR, MINUTE, SECOND) Parameter HOUR (required)- This parameter represents the hour for your time. MINUTE (required)- This parameter represents the...

1 minute read.

Solver in Excel

What is Solver? Microsoft Excel facilitates an add-in programming tool known as Solver that uses operational research techniques to find the optimal solutions for objective problems. This tool operates with a group of...

5 minutes read.

How to apply Data Protection to the Worksheet?

What do we mean by Data Protection? Data Protection in excel involves in protecting your file/data from some other user and also prevents the following accidents – Accidentally deleting or changing the formulas in...

3 minutes read.

Excel DAYS() Function

The DAYS() function in excel returns the number of days that exist between two dates. Syntax DAYS (end_date, start_date) Parameter end_date (required)- This parameter represents the end date. start_date (required)- This parameter represents the start date. Category Date...

1 minute read.

How to Alphabetize in Excel?

Alphabetize in Excel One of the reasons for Excel's widest popularity is its ability to swiftly and effortlessly sort data. Excel facilitates easy methods that alphabetically sort the lists of strings...

5 minutes read.

Excel SUBSTITUTE() Function

The SUBSTITUTE() function in excel substitutes/replaces the old text with the new text in a string. SUBSTITUTE function is used to clean data. This function is case-sensitive. Syntax SUBSTITUTE(Text, Old_Text, New_Text, [instance_number]) Parameter Text (required)- This...

2 minutes read.

Application Interface and Key Components

The essential key components of Excel are as follows: Ribbon TabQuick Access ToolbarFormula BarActive CellColumnsRows Name BoxSheet TabsZoom ControlStatus Bar Ribbon Tab: The ribbon includes tabs labeled Home, Insert, Page Layout, Formulas, Data, Review,...

3 minutes read.

Blank cells in Excel

Microsoft Excel is spreadsheet software designed by Microsoft in 1987. It is used to perform arithmetic calculations in various fields like statistical, engineering and financial. Many times, we export data...

4 minutes read.

Excel SECOND() Function

Excel SECOND() Function The SECOND() function in excel converts a serial number to SECOND (0 - 59). Syntax SECOND (SERIAL_NUMBER) Parameter SERIAL_NUMBER (required)- This parameter represents the date or time from which you want to extract...

1 minute read.

Insert Row in Excel

It was known that we have various multiple ways that are extremely helpful in inserting a particular row in the Microsoft Excel. And we have lots of shortcut options available...

6 minutes read.

Excel COUNTBLANK() Function

Excel COUNTBLANK() Function The COUNTBLANK() function in excel counts the number of blank cells within a range. Syntax COUNTBLANK ([value1], [value [2], ...) Parameter value1(required)- This parameter represents the first cell in the range. value2, …(optional)- It represents...

1 minute read.