TRUE function
The TRUE function in Excel is a logical function that simply returns the value TRUE. It does not take any arguments.
Syntax:
=TRUE()
Example 1: Basic Usage
The TRUE function will always return the logical value TRUE, which can be used in formulas or conditions. For example:
=TRUE()
This will return TRUE.
Example 2: Using TRUE in an IF Statement
You can use TRUE in logical tests. For example, in an IF statement, if the condition evaluates to TRUE, the corresponding result is returned:
=IF(TRUE(), "Condition is true", "Condition is false")
Since TRUE() always returns TRUE, this formula will always return "Condition is true".
Example 3: Using TRUE in a Comparison
You can use TRUE in conditional comparisons, for example, in a formula to check if two values are equal:
=IF(A1 = B1, TRUE(), FALSE())
If the value in A1 is equal to the value in B1, the formula will return TRUE, otherwise FALSE.
Benefits:
- Constant value: It is useful when you need to include a logical
TRUEvalue in formulas. - Simplification: Instead of manually typing
TRUEin logical conditions, you can use the function for consistency, though it’s often more convenient to typeTRUEdirectly in formulas.
While TRUE() is technically a function, it’s often more practical to directly use the logical value TRUE in formulas, as it is automatically recognized by Excel.