Thursday, 5 June 2014

For Beginners: Excel Functions .If Function

For Beginners: Excel Functions .If Function

The if function is used to test a condition . one value will be returned if the condition is true and another value will be returned if the condition is false.

Syntax:
IF(logical-test, value-if-true, value-if-false)

In the above syntax logical test is the condition to be checked. Value-if- true is the value to be returned if the condition is true. Value-if-false  is the value to be returned if the condition is false.

Example:

=If(a2<=1000,”good budget”, ”bad budget”)
=if(d1>=40,”pass”, ”fail”)
=if(h1>15000,500,0)
 in the above examples a2, d1, h1 are cell addresses. 

And:

Using and function we can check more than one condition. If we use and along with if function it will return true only if all the conditions return true.

Example:

=If(AND(a1>=40,a2>=40),”pass”,”fail”)

In the above example, “pass” will be returned only if both a1 and a2 values are greater than or equal to 40. If even one condition is false,”fail” will be returned.



No comments:

Post a Comment