Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

66%
+2 −0
Q&A Conditionally format a pair of columns

First, such formatting is conditional, so there is no need for the IF functions here (nor, normally, in general for Conditional Formatting [CF]). Formatting is triggered when the response to a form...

posted 4y ago by pnuts‭  ·  last activity 3y ago by Alexei‭

Answer
#4: Post undeleted by user avatar Alexei‭ · 2021-05-26T18:06:58Z (over 3 years ago)
#3: Post deleted by user avatar pnuts‭ · 2020-12-07T15:31:43Z (about 4 years ago)
#2: Post edited by user avatar pnuts‭ · 2020-10-02T09:11:05Z (about 4 years ago)
  • First, such formatting is **conditional**, so there is no need for the IF functions here (nor, normally, in general for Conditiona Formatting [CF]). Formatting is triggered when the response to a formula is TRUE (or equivalent). So, for red fill:
  • =$K4>5
  • is sufficient, as is:
  • =$K4>=2
  • for yellow fill. (Or, `=$K4>1` if the 'K' values are always integers.)
  • Since say `6` is greater than both `5` and `2` either a range for validity should be set rather than just a minimum (elaborating the formula) or, as here, the red fill rule should be above the yellow fill rule in the *Conditional formatting rules* list.
  • Second, a quick fix assuming that all J:K pairs are to be coloured, is to forego CF for green. Instead apply 'standard' (green) fill to the entire range. CF fill overrides 'standard' fill.
  • Third, if not the quick fix, then a formula for green fill such as:
  • =$K4<2
  • Finally, the formula attempted does not work for `0`, while the others do what is required, because of how CF interprets values. CF deems `0` to be `FALSE` so the condition is not satisfied and therefore the associated formatting is not applied. Whereas, excluding `0`, the return of any number is deemed `TRUE` and the associated formatting triggered (as for the other rules).
  • First, such formatting is **conditional**, so there is no need for the IF functions here (nor, normally, in general for Conditional Formatting [CF]). Formatting is triggered when the response to a formula is TRUE (or equivalent). So, for red fill:
  • =$K4>5
  • is sufficient, as is:
  • =$K4>=2
  • for yellow fill. (Or, `=$K4>1` if the 'K' values are always integers.)
  • Since say `6` is greater than both `5` and `2` either a range for validity should be set rather than just a minimum (elaborating the formula) or, as here, the red fill rule should be above the yellow fill rule in the *Conditional formatting rules* list.
  • Second, a quick fix assuming that all J:K pairs are to be coloured, is to forego CF for green. Instead apply 'standard' (green) fill to the entire range. CF fill overrides 'standard' fill.
  • Third, if not the quick fix, then a formula for green fill such as:
  • =$K4<2
  • Finally, the formula attempted does not work for `0`, while the others do what is required, because of how CF interprets values. CF deems `0` to be `FALSE` so the condition is not satisfied and therefore the associated formatting is not applied. Whereas, excluding `0`, the return of any number is deemed `TRUE` and the associated formatting triggered (as for the other rules).
#1: Initial revision by user avatar pnuts‭ · 2020-10-02T00:44:49Z (about 4 years ago)
First, such formatting is **conditional**, so there is no need for the IF functions here (nor, normally, in general for Conditiona Formatting [CF]). Formatting is triggered when the response to a formula is TRUE (or equivalent). So, for red fill:

     =$K4>5

is sufficient, as is:

     =$K4>=2

for yellow fill. (Or, `=$K4>1` if the 'K' values are always integers.)

Since say `6` is greater than both `5` and `2` either a range for validity should be set rather than just a minimum (elaborating the formula) or, as here, the red fill rule should be above the yellow fill rule in the *Conditional formatting rules* list.

Second, a quick fix assuming that all J:K pairs are to be coloured, is to forego CF for green. Instead apply 'standard' (green) fill to the entire range. CF fill overrides 'standard' fill.

Third, if not the quick fix, then a formula for green fill such as:

    =$K4<2

Finally, the formula attempted does not work for `0`, while the others do what is required, because of how CF interprets values. CF deems `0` to be `FALSE` so the condition is not satisfied and therefore the associated formatting is not applied. Whereas, excluding `0`, the return of any number is deemed `TRUE` and the associated formatting triggered (as for the other rules).