Skip to content
SheetFluent

Logical functions: IF, AND, OR and IFERROR

A comparison like B2>=50 gives TRUE or FALSE. IF turns that answer into a result you choose: =IF(B2>=50,"Pass","Fail"). AND and OR let IF check two conditions, and IFERROR replaces an error with a message.

The topic then adds nested IF and IFS for more than two results, SWITCH for turning codes into names, and ISNUMBER, ISBLANK and ISERROR to check what a cell holds before you use it.

Start practicing

Lessons in this topic

  1. 1
    TRUE and FALSE comparisons

    Compare cells with =, <, >, >=, <= and <> to get TRUE or FALSE. This is the yes-or-no question every IF formula asks.

    About 4 minutes
  2. 2
    Choose a result with IF

    Use IF to show one result when a condition is TRUE and another when it is FALSE, in Excel and Google Sheets.

    About 5 minutes
  3. 3
    Check two things with AND and OR

    Use AND when every condition must be TRUE and OR when any one is enough, then put them inside IF.

    PlusAbout 5 minutes
  4. 4
    More than two results with nested IF

    Put one IF inside another to sort values into three or more bands, like grades or delivery fees.

    PlusAbout 6 minutes
  5. 5
    Replace errors with IFERROR

    Wrap a formula in IFERROR to show a clean value, like 0 or "New", instead of #DIV/0! when it can't be worked out.

    PlusAbout 4 minutes
  6. 6
    Grade bands with IFS

    Use IFS to pick a grade or tier from several bands in one formula, without nesting IF inside IF, in Excel and Google Sheets.

    PlusAbout 5 minutes
  7. 7
    Turn codes into names with SWITCH

    Use SWITCH to turn short codes into full names, with a default value for any code that isn't on your list.

    PlusAbout 5 minutes
  8. 8
    Check a cell with ISNUMBER, ISBLANK and ISERROR

    Test whether a cell holds a number, text, nothing or an error with the IS functions, then use IF to show a clear message.

    PlusAbout 6 minutes

Next topic: Conditional totals