Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditionally format a range based on a different range

Given the sheet:

A| B | C = SUM($D2:$Z2) | D | E | F | ...

How would I, for a range of rows (for example: 4:50), color columns Cx:Zx (for row x) if Bx > Cx, without making a conditional rule for each individual row and/or each individual column?

(Assume there are a lot of rows and a lot of columns.)

like image 594
kando Avatar asked Jun 16 '26 06:06

kando


1 Answers

There are several Q&A on Stackoverflow that would assist you. In particular Conditional formatting based on another cell's value and the answer (with the attached comments) by Zig Mandel. It's a reminder that some Googling is always worthwhile before asking a new question.

  • Select "Custom formatting" from the Format menu.
  • Set "Apply to Range" to C2:Z50
  • "Format cells if", select "Custom formula is" and enter =$B2:$B>$C2:$C
  • Select Done.

B is less than C
B is less than C


B is greater than C
enter image description here

Screen shots

like image 152
Tedinoz Avatar answered Jun 19 '26 13:06

Tedinoz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!