Beginner’s Guide: Use the IF Function in Google Sheets

Learn how to make Google Sheets return different values based on a condition using the IF function. Follow a few simple steps to test a cell and show one result if true and another if false.

What the video covers

Show how to build a simple IF formula that tests a condition and returns one value when true and another when false.

Watch the video on YouTube

Step-by-step instructions

  1. Select the result cell
    Click the cell where you want the IF result to appear.
  2. Start the formula
    Type =IF( to begin the function.
  3. Enter the condition
    Type a logical test such as A150 to check whether the referenced cell meets your condition.
  4. Specify the true result
    After a comma, enter the value or expression to return when the condition is true (for example "Pass" or 1).
  5. Specify the false result
    Add another comma, then enter the value or expression to return when the condition is false (for example "Fail" or 0).
  6. Close and apply
    Close the parentheses ), then press Enter to apply the formula and see the outcome.
  7. Test and adjust
    Change the referenced cell(s) to confirm the formula returns the expected true and false values. Edit the logical test or returned values as needed.

Watch the video

Video thumbnail for Beginner’s Guide: Use the IF Function in Google Sheets Play tutorial

Watch on YouTube

Why it matters

The IF function lets your spreadsheet make decisions so you can automate grading, pass/fail checks, basic budgeting logic, and other conditional results without manual edits.

Check your result

After entering the formula you should see one value when the tested cell meets the condition and the alternate value when it doesn't. Change the tested cell to confirm both results appear as expected.

Troubleshooting

If you see an error or unexpected result: ensure the formula starts with =IF(, check commas and parentheses, verify the condition uses correct comparison operators (, , =, =, =, ), and confirm referenced cells contain the expected data type (numbers vs text).