How to Use the IF Function in Excel

Check for the empty cell value

There will be some cases in which the user has to find the rows or columns which is empty but applying the formula manually is not possible for hundreds of cells so we can use the IF function.

The formula used is:= if (logical argument=””,””, “value”)

Let’s consider the below example, In this example, we have data on customers purchasing items and we have the number of items. To find the total amount of Customers we have used the formula = IF(C2=”,””, C2*D2) is checking values for C2 and if C2 is empty it will return empty, and if C2 has a value it will return C2* D2.

 

IF Function (Greater than)

Let’s say you want to find out if all the students in a particular class PASSED or FAILED their tests. But, we can’t do that manually for 100 students. So, we can define the IF condition for one cell and apply it to all the cells we want.

APPLYING TO ONE CELL

Now, let’s apply it to all the cells in the column.

ALL CELLS

Now, let us try using IF with a bit more complex condition. Say, you have a list of clients, and who have made purchases from your store. Now, according to your store policy, you can provide a discount of Rs.500 to all clients that make purchases strictly above Rs.6,000. So, let’s add that condition to our sheet.

Some clients are eligible for Discounts while some are not.

Excel IF function With Examples

The IF function is one of Excel’s most used, if not the most used functions. It helps perform a single or a series of logical comparisons between entities. It works using the same principles as IF-ELSE conditional statements, used in most programming languages. Values satisfying the given condition, result in a positive output, while values not satisfying the given condition, result in a negative output. Condition and Return values both can be decided by the user.

Python Code (For reference)

Similar Reads

IF Function in Excel

The IF Function is an inbuilt function in Excel, which return values based on true or false condition....

Syntax of IF Function

The IF function serves a single purpose, i.e., to run tests for specific conditional statements....

Return Value

IF function will return the values, “TRUE” or “FALSE” or the values specified by the user to be used in place of TRUE and FALSE....

Parameters

The term argument refers to any expression that is enclosed inside the parenthesis of a function call....

How to Use the IF Function in Excel

Check for the empty cell value...

Nested If Function

We use the Nested IF function if we have multiple criteria to find and decide the final output....

IF Function with AND, OR, NOT

IF function, logical operators, help you to deal with complex conditions....

Excel IF Function Multiple Conditions

IF Formula with multiple criteria based on the AND / OR logic. Consequently, in the logic test of your IF formula, you can use one of these functions:...

FAQs

What is the IFS function? Instead of using multiple Nested if functions, IFS can be used. You can test multiple conditions, to see if they are TRUE. The Formula returns the result for the First True condition. The syntax for the IFS function is: = IFS([Something is true 1, Value if true 1, Something is true 2, Value if true 2, Something is true 3, Value if true 3)....

Contact Us