Conditional Highlighting Entire Row (Based on a single cell containing ":")

I am working on the spreadsheet shown below. I need to find a way to do Conditional Highlighting or Formatting on an entire row based on a specific cell of that row containing specific text (or any alternative way to automatically highlight a row based on a condition that I could make work for my intention.


See B3 and B26? Currently, I am wanting to automatically format these rows. Since the only time I would use a colon (":") is in the rows I want to highlight black and switch the text to white, I tried to set up a Conditional Highlighting rule: Conditional Highlighting>Add a Rule>Text>Contains>":">Custom Style>(White text and black background)>Done.


When I complete this rule, cell B3 and B26 apply then proper formatting, but I need the ENTIRE row to the left and right of those cells to be the same format. (So cells A3-Q3 would need to be black background with white text). How does one do this?

MacBook Pro 16″, macOS 14.3

Posted on Feb 13, 2024 11:52 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 13, 2024 6:35 PM

ZanderCam7 wrote:

Since the only time I would use a colon (":") is in the rows I want to highlight black and switch the text to white, I tried to set up a Conditional Highlighting rule:


Yes, you can do this with Conditional Highlighting with a Rule like this:




Add an additional column with a formula that places a character if there is a : in Column B. You can hide that column later if you want.


In H2 of my example, filled down, I have:


=IF(COUNTMATCHES($B2,":")=0,"~","")


The I selected the range to be highlighted, A2:G10 in my example, and set up the rule.


Note that you need $H2 in the address token (i.e. Preserve Column, but don't Preserve Row):




I think I got this general 'Text ends with' ("blank") approach some years ago from a post by Badunit. Kudos to him!


SG

9 replies
Question marked as Top-ranking reply

Feb 13, 2024 6:35 PM in response to ZanderCam7

ZanderCam7 wrote:

Since the only time I would use a colon (":") is in the rows I want to highlight black and switch the text to white, I tried to set up a Conditional Highlighting rule:


Yes, you can do this with Conditional Highlighting with a Rule like this:




Add an additional column with a formula that places a character if there is a : in Column B. You can hide that column later if you want.


In H2 of my example, filled down, I have:


=IF(COUNTMATCHES($B2,":")=0,"~","")


The I selected the range to be highlighted, A2:G10 in my example, and set up the rule.


Note that you need $H2 in the address token (i.e. Preserve Column, but don't Preserve Row):




I think I got this general 'Text ends with' ("blank") approach some years ago from a post by Badunit. Kudos to him!


SG

Feb 14, 2024 2:45 PM in response to Jerrold Green1

You didn't miss anything. Numbers does not include a direct way to highlight an entire row. Each cell has to highlight itself individually. Selecting A2:G10 lets you create individual rules for all those cells at once, all of which will compare themselves to the corresponding cell in column H if the reference is $H2


The "text ends with" method is a trick to highlight a row using the knowledge that all text ends with the null string "", or at least it does according to the highlighting rules. The trick requires an additional column (cell) that will be either "" or an obscure character that no cell's text ends with. Multiple rules (such as for multiple cell colors) can be created, each rule requiring an additional column.



Feb 14, 2024 9:03 PM in response to Jerrold Green1

Jerrold Green1 wrote:

I never would have guessed that "Text Ends With" would look at the content of the last cell in a row, not necessarily in the Selection, and ignore what was in the other cells included in the Selection


'Text Ends With' looks at the top left cell of the exception (not the content of the last cell in a row) and compares its value to the value in the cell specified in the Rule, in my example H2. This just happens to be the last cell in the row, but it doesn't have to be.


The anchors in the reference help tell Numbers what the other cells in the selection should be compared to.


SG

Feb 13, 2024 3:05 PM in response to Jerrold Green1

"R" Columns are "Remaining", which are the remaining number of publications during replenishment. These are entered manually.


"T" Columns are "Taken", which are the number of publications taken the prior week. These are computed automatically via the formula:


"=IF {R-Column}="","",{(Prior Delivered Column)-(Current Remaining Column)}"


Basically, if no numbers are in the current "R" column, the "T" column will remain blank. Once a number is input into the current "R" column, the "T" column calculates the number of publications that were "taken" based off of what was delivered the prior week and what is remaining the current week.


"D" Columns are "Delivered", which are the number of publications delivered during that week. These are entered manually.

Feb 14, 2024 11:55 AM in response to SGIII

I never would have guessed that "Text Ends With" would look at the content of the last cell in a row, not necessarily in the Selection, and ignore what was in the other cells included in the Selection, and act on the entire Row. Also the relative addressing with the Column reference being pinned intrigued me.


I've spent decades thinking that Apple missed the boat on that one, only to learn it was just hidden.


Jerry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Conditional Highlighting Entire Row (Based on a single cell containing ":")

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.