How to use if function in excel

How to use if function in excel

The IF function is one of Excel's most common features, allowing you to make rational distinctions between a value and what you expect.

As a consequence, an IF argument may have two outcomes. If your analogy is True, the first result is True; if your comparison is False, the second result is False.

The IF function is an Excel built-in function that is classified as a Logical Function. It can be found in Excel as a worksheet feature (WS). The IF function is a worksheet function that can be entered as part of a formula in a worksheet cell.

But first, we'd like to introduce the mind behind this wonderful piece. The Watchtower, a leading Digital Marketing Company, and Web Design Agency in Dubai enjoy educating their readers on useful tips to improve their daily operations.

Syntax

In Microsoft Excel, the syntax taught in Excel training London for the IF function is:

IF( condition, value if true, value if false)

Arguments or Parameters condition

The worth you want to put to the test.

value_if_true

If the condition evaluates to TRUE, this value is restored.

value_if_false

It is optional. If the condition evaluates to FALSE, this value is restored.

Returns

The IF function returns value_if_true when the condition is TRUE.

The IF function returns value_if_false when the condition is FALSE

If the value_if_false parameter is omitted and the condition is FALSE, the IF function returns FALSE.

TIP: If you're using Excel 2016 or later, give the latest IFS feature a shot (to specify up to 127 conditions).

Worksheet feature applies to Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, and Excel 2000. (WS)

We hope you're getting something out of this. The primary goal of our articles is to keep you updated about all of the simple resources needed to succeed in today's fast-paced environment. When it comes to the Watchtower, some of our main strengths include Web Design Dubai and Digital Marketing.

Using the IF function in conjunction with Other Logical Functions

When writing the formula in Excel, you would often need to define more complicated conditions. The IF function can be combined with other logical functions such as AND, OR, and so on. Let's dig a little deeper into this.

AND Function

The IF function can be used in conjunction with the AND function to evaluate for different conditions. For the criterion to be satisfied by using the AND function, all conditions within the AND function must be TRUE. This is very useful in Excel calculations.

You can combine the IF function with the AND function as follows:

=IF(AND(A2="Anderson",B2>80), "MVP", "regular")

Result: "MVP"

=IF(AND(B2>=80,B2<=100), "Great Score", "Not Bad")

Result: "Great Score"

=IF(AND(B3>=80,B3<=100), "Great Score", "Not Bad")

Result: "Not Bad"

=IF(AND(A2="Anderson",A3="Smith",A4="Johnson"), 100, 50)

Result: 100

=IF(AND(A2="Anderson",A3="Smith",A4="Parker"), 100, 50)

Result: 50

In the examples above, all conditions within the AND function must be TRUE for the condition to be met.

OR function

The IF function can be combined with the OR function to allow you to test for multiple conditions. But in this case, only one or more of the conditions within the OR function needs to be TRUE for the condition to be met.

you can combine the IF function with the OR function as follows:

=IF(OR(A2="Apples",A2="Oranges"), "Fruit", "Other")

Result: "Fruit"

=IF(OR(A4="Apples",A4="Oranges"),"Fruit","Other")

Result: "Other"

=IF(OR(A4="Bananas",B4>=100), 999, "N/A")

Result: 999

=IF(OR(A2="Apples",A3="Apples",A4="Apples"), "Fruit", "Other")

Result: "Fruit"

In the examples above, only one of the conditions within the OR function must be TRUE for the condition to be met.

Please Note: If you are going to use text in formulas, you need to wrap the text in quotes (e.g. "Text"). The only exception to that is using TRUE or FALSE, which Excel automatically understands.

We hope you enjoyed reading it and learned something new, as that is our main goal. We will always supply you with amazing web content as the leading and award-winning Website Development Company in Dubai.

  • Share:

Comments (0)

Write a Comment