Publishers of technology books, eBooks, and videos for creative people

Home > Articles

  • Print
  • + Share This
This chapter is from the book

Using Comparison Operators

You can use cell references or constants in comparisons. The expression A1=A2, for example, is TRUE if cell A1 contains the same value as cell A2. Comparison operations mainly are used in IF, AND, OR, NOT, SUMIF, COUNTIF, and other functions that take expressions that can be evaluated as TRUE or FALSE. For example, the formula

=IF(B2=0, 0, B1/B2)

uses a comparison to avoid dividing by zero.

Comparisons don’t have to be embedded in functions; you can type them as stand-alone formulas. For example, the formula

=A1=5

will display TRUE or FALSE in a cell depending on the value in A1. Note that it’s clearer to enter this formula as

=(A1=5)

To insert a comparison operator in a formula:

  1. In the formula bar, position the insertion point where you want the operator to appear.
  2. If the comparison-operator keys aren’t visible on the left side of the formula keyboard, tap the &≤≠ key.
  3. Tap an operator key circle-a.jpg.
  • + Share This
  • 🔖 Save To Your Account