How to use the IF formula in Google Sheets
Learn how to write IF formulas in Google Sheets to test conditions, return custom results, and automate decisions in your data.

Quick answer
To use the IF formula in Google Sheets, click an empty cell and type =IF(logical_test, value_if_true, value_if_false), replacing each argument with your condition and results. Press Enter to run the calculation. For example, =IF(B2>50,"Pass","Fail") checks a value and returns one of two outcomes based on whether the condition is met.
Steps at a glance
- Select an empty cell for the result
- Type =IF( to start the formula
- Enter your logical test condition
- Add the value to return if true
- Add the value to return if false
- Close the parenthesis and press Enter
- Copy the formula down for other rows
Summary
The IF formula lets you set up conditional logic in Google Sheets, automatically returning different results depending on whether a cell meets a condition you define. It's one of the most useful formulas for building reports, grading systems, budgets, and dashboards that update themselves as your data changes.
Step-by-step guide
Step 1
Open your spreadsheet and select a cell
Open the Google Sheets file where you want to add conditional logic. Click the empty cell where you want the IF formula's result to appear, such as a column next to your raw data.
Step 2
Start typing the IF formula
Type =IF( into the selected cell. Google Sheets will show a small syntax hint above the cell reminding you of the three required arguments: logical_test, value_if_true, and value_if_false.
Step 3
Write the logical test
Enter the condition you want to check, referencing a cell instead of typing a fixed value. For example, B2>50 checks whether the value in cell B2 is greater than 50, while B2="Yes" checks for an exact text match.
Step 4
Add the true and false results
After a comma, type the value or text you want returned if the condition is true, then add another comma and the value to return if it's false. Wrap any text results in double quotes, like "Pass" or "Fail", but leave numbers unquoted.
Step 5
Close the formula and press Enter
Add a closing parenthesis so the full formula looks like =IF(B2>50,"Pass","Fail"), then press Enter. Sheets calculates the result immediately and displays either the true or false value in the cell.
Step 6
Copy the formula to other rows
Click the cell with your finished formula, then drag the small blue square in the bottom-right corner down through the rows you want to apply it to. Sheets automatically adjusts the cell references for each row, so you don't have to retype the formula manually.
Step 7
Combine IF with other tools if needed
For more advanced checks, nest additional IF statements inside the true or false arguments, or pair IF with AND/OR to test multiple conditions at once. You can also apply results visually using conditional formatting rules or highlight results after running a filter on the output column.
Why this matters
You're reviewing a spreadsheet of sales totals, test scores, or inventory counts and need to flag rows that meet a threshold without manually checking each one. Mastering the IF formula lets Sheets label, calculate, or sort results automatically, saving you time on repetitive manual review.
Frequently asked questions
What is the basic syntax of the IF formula in Google Sheets?
The syntax is =IF(logical_test, value_if_true, value_if_false). The logical_test is the condition you're checking, and the other two arguments define what the cell displays depending on whether that condition is true or false.
Can I use multiple conditions in one IF formula?
Yes. Nest an AND or OR function inside the logical_test argument, such as =IF(AND(B2>50,C2="Active"),"Pass","Fail"), to check more than one condition before returning a result.
Can I nest IF formulas inside each other?
Yes, this is called a nested IF. You place a second IF formula inside the value_if_true or value_if_false argument of the first one to test additional conditions and return more than two possible outcomes.
Does the IF formula work the same way after importing data from a CSV file?
Yes, once your data is in the sheet it behaves like any other cell reference. If you're working with imported data, review [how to import a CSV file](/guides/google-sheets/import-csv) first to confirm your columns are formatted correctly before applying formulas.
Create interactive demos like this one — free, no coding required.
Start for free →