# Can you do an if statement in Google Sheets?

## Can you do an if statement in Google Sheets?

The IF function can be used on its own in a single logical test, or you can nest multiple IF statements into a single formula for more complex tests. To start, open your Google Sheets spreadsheet and then type =IF(test, value_if_true, value_if_false) into a cell.

### How does if function work in Google Sheets?

IF function in Google Sheets can be used when you want to check a condition and then based on it, returns a specified value if it’s TRUE, or else return the other specified value. For example, suppose you are evaluating marks obtained by students in an exam and you want to know if the student has passed or not.

#### How do you write an if statement in conditional formatting in Google Sheets?

Use advanced conditional formatting

- On your computer, open a spreadsheet in Google Sheets.
- Select the cells you want to format.
- Click Format. Conditional formatting.
- Under the “Format cells if” drop-down menu, click Custom formula is.
- Click Value or formula and add the formula and rules.
- Click Done.

**How do I use multiple if conditions in Google Sheets?**

How to Use Multiple IF Statements in Google Sheets

- If the value in cell A2 is less than 10, return the value “Bad”
- Otherwise, if the value in cell A2 is less than 20, return the value “Okay”
- Otherwise, if the value in cell A2 is less than 30, return the value “Good”
- Otherwise, return the value “Great”

**Is there an if/then else function in Excel?**

Just like a yes-no question, if the specified condition is true, Excel returns one user-determined value and, if false, it returns another. The IF statement is also known as a logical formula: IF, then, else. If something is true, then do this, else/otherwise do that.

## Can you use an IF formula in conditional formatting?

But in conditional formatting, IF/THEN/ELSE syntax cannot be applied in a single rule. Conditional formatting is applied using IF/THEN logical test only. It must return TRUE for conditional formatting to be applied.