2

Is it possible to conditionally format the background colour of a cell, based on the value in the column preceding it?

For example, in the following table (first row/column are titles):

  | A | B | C
1 | 1 | 5 | 2
2 | 2 | 7 | 0
3 | 3 | 1 | 2
4 | 1 | 3 | 4
5 | 1 | 5 | 0
6 | 4 | 1 | 2
7 | 8 | 2 | 4

B1 should be green, as it is greater than A1.

but

C5 should be red, as it is less than B1, etc

I'd like this formatting rule to work with any new column I add. The dataset I'm working with is date driven analytics.

Try as I might, I can either only seem to format the cells by:

  • A fixed number
  • A fixed cell
0

1 Answer 1

3

You can conditionally format based on another cell or column by selecting your cells, and making a conditional formatting rule for cells "Greater Than" the cell "A1" as shown below.

Sheets uses this as a relative reference that you're comparing the cell to the left of each cell in your selection.

Screenshot

1
  • Doh! I was just missing the '='. Thanks @Rob
    – Jon Hadley
    Commented Oct 13, 2015 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.