Can I use an IF formula in conditional formatting Google Sheets?

Show

Conditional formatting is a feature in Google Sheets in which a cell is formatted in a particular way when certain conditions are met. The formatting can include highlighting, bolding, italicizing – just about any visual changes to the cell.

Can I use an IF formula in conditional formatting Google Sheets?

Just as it can be done for the cell you’re currently in, conditional formatting can also be set based on conditions met in another cell.

Can I use an IF formula in conditional formatting Google Sheets?

Let’s dive into how to create this condition based on multiple criteria.

To learn how to set conditional formatting, let’s use this workbook as an example.

Can I use an IF formula in conditional formatting Google Sheets?

It’s a workbook showing website traffic year over year from Q4 2020 to Q4 2021, with the page views along with the year-over-year percentage change.

Here’s what we want to accomplish here: When the percentage change is positive YoY, the cell turns green. When it’s negative, the cell turns red. This makes it easy to get a quick performance overview before diving into the details.

Here are the steps to set the conditional formatting.

1. Select the cell you want to format, click on "Format" from the navigation bar, then click on "Conditional Formatting."

Can I use an IF formula in conditional formatting Google Sheets?


2. While staying in the "Single color" tab, double-check that the cell under "Apply to range" is the cell you want to format.


3. Set your format rules.

Can I use an IF formula in conditional formatting Google Sheets?

It may automatically default to a standard conditional formatting formula. In this case, open the dropdown menu under "Format cells if…" to select your rules. Options will look as follows:

4. Choose your formatting style, then click "Done."

5. Confirm the rule was applied under "Conditional Formatting Rules."

Can I use an IF formula in conditional formatting Google Sheets?

6. Add another rule if needed.

Can I use an IF formula in conditional formatting Google Sheets?

7. Return to cell to view formatting, then drag the cursor to apply to other cells, if needed.

Can I use an IF formula in conditional formatting Google Sheets?

Now that you understand the basics, let’s cover how to use conditional formatting based on other cells.

Conditional Formatting Based on Another Cell Value

1. Select the cell you want to format.

Can I use an IF formula in conditional formatting Google Sheets?

2. Click on "Format" in the navigation bar, then select "Conditional Formatting."

Can I use an IF formula in conditional formatting Google Sheets?

3. Under "Format Rules," select "Custom formula is."

Can I use an IF formula in conditional formatting Google Sheets?

4. Write your formula, then click "Done."

Can I use an IF formula in conditional formatting Google Sheets?

5. Confirm your rule has been applied and check the cell.

Can I use an IF formula in conditional formatting Google Sheets?

Conditional Formatting Based on Another Cell Range

To format based on another cell range, you follow many of the same steps you would for a cell value. What changes is the formula you write.

1. Select the cell you want to format.

Can I use an IF formula in conditional formatting Google Sheets?

2. Click on "Format" in the navigation bar, then select "Conditional Formatting."

Can I use an IF formula in conditional formatting Google Sheets?

3. Under "Format Rules," select "Custom formula is."

Can I use an IF formula in conditional formatting Google Sheets?

4. Write your formula using the following format: =value range < [value], select your formatting style, then click "Done."

Can I use an IF formula in conditional formatting Google Sheets?

5. Confirm your rule has been applied and check the cell.

Can I use an IF formula in conditional formatting Google Sheets?

Conditional Formatting Based on Another Cell Not Empty

  1. Select the cell you want to format.
  2. Click on 'Format' in the navigation bar, then select 'Conditional Formatting.'
  3. Under 'Format Rules,' select 'Custom formula is.'
  4. Write your formula using the following format: =NOT(ISBLANK([cell#)), select your formatting style, then click 'Done.'
  5. Confirm your rule has been applied and check the cell.

Google Sheets Conditional Formatting Based on Another Cell Color

Currently, Google Sheets does not offer a way to use conditional formatting based on the color of another cell. You can only use it based on:

  • Values – higher than, greater than, equal to, in between
  • Text – contains, starts with, ends with, matches
  • Dates – is before, is after, is exactly
  • Emptiness – is empty, is not empty

To achieve your goal, you’d have to use the condition of the cell to format the other.

Let’s use an example.

Can I use an IF formula in conditional formatting Google Sheets?

Say you want to format cell A2 (September 2020) to be red and match the color of cell E2 (-20%). There’s no formula that allows you to create a condition based on color. However, you can create a custom formula based on E2’s values.

You can say that if cell E2’s values are less than 0, cell A2 turns red. The formula is as follows: = [The other cell] < [value]. In this case, the formula would be =e2<0, as it signifies that cell A2 should turn red if E2’s value is less than 0.

Can I use an IF formula in conditional formatting Google Sheets?

With so many functions to play with, Google Sheets can seem daunting. By following these simple steps, you can easily format your cells for quick scanning.

Can I use an IF formula in conditional formatting Google Sheets?

Can I use an IF formula in conditional formatting in sheets?

One of the methods to achieve Conditional formatting based on a custom formula is using the IF statement. The IF function works on the IF/THEN/ELSE condition syntax.

Can you use if and in conditional formatting?

Using AND, OR and NOT with Conditional Formatting You can also use AND, OR and NOT to set Conditional Formatting criteria with the formula option. When you do this you can omit the IF function and use AND, OR and NOT on their own. From the Home tab, click Conditional Formatting > New Rule.

Can you use an if statement to color a cell Google Sheets?

Google Sheets conditional formatting allows you to change the aspect of a cell—that is, a cell's background color or the style of the cell's text—based on rules you set. Every rule you set is an if/then statement. For example, you might say "If cell B2 is empty, then change that cell's background color to black."

Can you use an if statement to color a cell?

Apply an If-Then rule to all cells by pressing “Ctrl-A” before assigning your rule. If you copy values from colored cells and paste them into new it new cells, the new cells acquire the color of the copied cell. You may find the “Text Contains” rule useful when working with alphanumeric data.