Quantunet.com

My Account

Joins Us
Excel QuickSkills
The IF() Function Knowledgebase  

 

The IF() function perfroms a specified logical test then returns a logical value, number, cell refernce or text string to the cell.

  • The syntax for the function is IF (logical test, value_if_true, value_if_false).

Where "logical_test" represents a formula or condition to be tested by the function, "value_if_true" and "value_if_false" are "programmed" responses to the test.

The IF function can be used in conjunction with multiple operators to perform different types of logical analysis. For example: IF(A2 >B2,"TRUE","FALSE") checks to see if a the value of the contents of cell A2 is greater than B2.For example: IF(4< 6, "TRUE","FALSE") = TRUE as 4 is less than 6 the condition is met and so the string "TRUE" is returned.

Text strings do not have to be ones that are automatically interpreted as logical values like TUE or FALSE they can be also be comments or replys. e.g. IF( A2=B2. "Well done you have passed", " Sorry you have failed please try again").

The "value_if_true" and "value_if_false" values can also be formulas e.g. IF(A2=B2, C2*D2, E2*F2). When A2=B2 the function then calculates C2*D2 and returns the value to the cell. When A2 is not equal to B2 the function calcuates E2*F2 and return the result to the cell instead.


How to use the IF() function:

  • Type " =IF( "
  • Enter the coordinate of the data cell "A2"
  • Type an operator symbol.
    Enter the coordinate of the data cell "B2"
  • Type a comma.
  • Enter the response is the condition is met "1".
  • Type a comma.
    Enter the response for when the condition is not met "2".
  • Type a ")" then press the "Enter" key.

 




Note: If no argument is entered for the "value_If_false" value the function will return a value of zero to the cell when the tested condition is not met. e.g. IF(A2=B2, 2) = 0when A2 is not equal to B2.

If Function Applications
The IF function is...


How to use the IF() function:

  • Type " =IF( "
  • Enter the coordinate of the data cell "A2"
  • Type an operator symbol.
    Enter the coordinate of the data cell "B2"
  • Type a comma.
  • Enter the response is the condition is met surrounded by quotation marks.
  • Type a comma.
    Enter the response for when the condition is not met surrounded by quotation marks.
  • Type a ")" then press the "Enter" key.

 





© 2007 Quantunet LLC All Rights Reserved | Intellectual Property | Terms of Use | Privacy
Home | About Quantunet | FAQ's | Contact Us