<

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Logical Thinking Put to Use - Excel's IF Function

Published on
9,317 Points
3,217 Views
1 Endorsement
Last Modified:
Approved
In Excel the IF function is used to return a condition based on both the TRUE and FALSE evaluations of an argument.

The syntax for the IF function is:

=IF ( logical_test, value_if_true, value_if_false )

Open in new window


logical_test - a value or expression that is tested to see if it is true or false.

value_if_true - the value that is displayed if logical_test is true.

value_if_false - the value that is displayed if logical_test is false.

Before you get into creating an IF function, it is best to write out exactly what you are attempting to accomplish.  If you can explain it logically, you can write the arguments!

If cell A1 is equal to or greater than "20", then return the value "Approved"; otherwise, return the value "Denied"

Your brain is already aware of steps to take and how to proceed by the reading the statement above.  Excel is half way there as well!  Let's take the function apart and identify the arguments:

=IF( (notifies Excel we are going to be starting an IF function)
A1 (the cell we are wanting to verify)
>=20, (asking if the value is equal to or greater than "20"
"Approved", (what to return if the above query is TRUE
"Denied") (what to return if the above query is FALSE

Putting this all together, we will come up with the following string:

=IF(A1>=20, "Approved", "Denied")

Open in new window


Now that we have the arguments settled, we can test it out.  By inserting the value "10" in  cell A1, we will be given the value "Denied" in the cell where this function is located.

By inserting the value "22" in cell A1, we will be given the value "Approved" in the cell where this function is located.

Now what if you wanted to perform another function in the event that the above value was returned as FALSE ("Denied")?  We can evaluate the need to nest the IF functions:  

If cell A1 is equal to or greater than "20", then return the value "Approved"; otherwise, if cell B1+A1 is equal to or greater than "40", then return the value  "Approved"; otherwise, return the value "Denied"

Here, we have added another set of arguments to our previous scenario.  By adding another IF function, we are redirecting the FALSE argument to perform another process before ending.  Adding to the code above, we would now write:

=IF(A1>=20, "Approved", IF((A1+B1)>=40, "Approved", "Denied"))

Open in new window

1
Comment
0 Comments

Featured Post

Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Join & Write a Comment

This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month