Monday, August 22, 2011

How to Use Excel's TRUE Function


1. Learn the syntax for TRUE: it is TRUE(). This function does not require any arguments. Similarly FALSE() always evaluates to FALSE.
2. Use TRUE with the IF function. TRUE might be used for testing purposes to force a certain value to be returned. For example, consider the IF statement: IF (logic_test;true_value;false_value). If logic_test evaluates to TRUE, true_value is returned, otherwise false_value is returned.
3. Look at the following IF statement:IF (TRUE();'is true';'is false')This IF statement will always return the first value. This might be useful during testing if we were not sure what value was being returned.
4. Examine the use of TRUE() with the following AND function:AND (condition1;condition2)AND returns TRUE only if all of its arguments evaluate to TRUE. If during testing we were not sure what condition1 evaluated to, we might substitute TRUE() for condition2 thus:AND (condition1;TRUE())If this AND statement returned TRUE, we would know that condition1 was true.
5. Test an OR function with TRUE(). The statement
OR(condition1:condition2;...) returns TRUE if any condition is TRUE and returns FALSE if all conditions are FALSE. Assume this OR is returning FALSE, and we need it to return TRUE for testing purposes. We could temporarily change one of the conditions to TRUE().

Blogger news