Relational Operators
Relational operators are used inside the IF function to compare two values. They represent six basic tests that can be employed to construct a conditional formula.
The following examples show formulas that display the first text string if a condition is met or the second string if the condition is not met.
- Equal: =—A1 and A2 are equal:
=IF(A1=A2; "A1 is equal to A2"; "A1 and A2 not equal")
- Less than: <—A1 is less than A2:
=IF(A1<A2; "A1 is less than A2"; "A1 is not less than A2")
- Greater than: >—A1 is greater than A2:
=IF(A1>A2; "A1 is greater than A2"; "A1 is not greater than A2")
- Less than or equal to: <=—A1 is less than or equal to A2:
=IF(A1<=A2; "A1 is less than or equal to A2"; "A1 is not less than or equal to ...
Get Beginning OpenOffice Calc: From Setting Up Simple Spreadsheets to Business Forecasting now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.