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
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...
Answer
#2: Post edited
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
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).