You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Change the formatting of a cell based on the value of another cell

I have a sheet where I continuously add new rows, one of the column contains a local menu with 7 choices in them. Based on which value is selected in that column I want the whole row to have a given background color.


I am able to set up rules for cell formatting for that column, for example if the selected value in the local menu is "Posted" I paint that cell green, if it's "Paid" it's painted yellow. But I want that green or yellow color to apply to the whole row not just the column that contains the value. So if I change the value in that column from Paid to Posted I want the whole row to change from yellow to green.


How do I do that?

Posted on Nov 25, 2022 10:27 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 26, 2022 3:02 AM

There is a way to highlight an entire row without too much trouble.


The idea is to set up an extra column that can later be hidden. In that column you put a formula that places a special character of certain conditions are not met, otherwise nothing. Then you base your Conditional Formatting on a comparison to cells in that column.


Here is a simple example:




The formula in E2, filled down, is:


=IF(NOT(D2="Request"),"~","")


The Conditional Highlight rule is shown in the screenshot. To enter it you select the range, in this example A2:A5, Add a Rule, choose Text ends with, click the token in the box, then E2, and make sure to check Preserve Column.


This works for one highlighting color. Not sure how it could be extended to multiple colors as in your screenshot, though.


SG


Similar questions

7 replies
Question marked as Top-ranking reply

Nov 26, 2022 3:02 AM in response to RemyDemarest

There is a way to highlight an entire row without too much trouble.


The idea is to set up an extra column that can later be hidden. In that column you put a formula that places a special character of certain conditions are not met, otherwise nothing. Then you base your Conditional Formatting on a comparison to cells in that column.


Here is a simple example:




The formula in E2, filled down, is:


=IF(NOT(D2="Request"),"~","")


The Conditional Highlight rule is shown in the screenshot. To enter it you select the range, in this example A2:A5, Add a Rule, choose Text ends with, click the token in the box, then E2, and make sure to check Preserve Column.


This works for one highlighting color. Not sure how it could be extended to multiple colors as in your screenshot, though.


SG


Nov 26, 2022 4:19 AM in response to RemyDemarest

Hi RemyDemarest


Here is one way. Duplicate the table and apply Conditional Highlighting. We will slide that table underneath Table 1.

We need a Lookup table (yes, the colours of the rainbow as an example).


Formula in Table 1-1 A2: INDEX(Lookup::$B,MATCH(Table 1::$D2,Lookup::$A,0))


Edit: I see that your region uses semicolons

Fill down and fill right.


Now to colour the cells in Table 1-1: (text colour must match the cell fill to become hidden).



With Table1-1 selected, change the text colour of the table title to white. Then the title will not show, but it will occupy the same space as the title of Table 1.

Format Panel > Arrange > Back.

Now slide Table 1-1 underneath Table 1:



Not ideal; the cell borders do not match.

Perhaps another user will step in to help.


Regards,

Ian.



Nov 26, 2022 4:17 AM in response to Yellowbox

Hi RemyDemarest


Here is one way. Duplicate the table and apply Conditional Highlighting. We will slide that table underneath Table 1.

We need a Lookup table (yes, the colours of the rainbow as an example).


Formula in Table 1-1 A2: INDEX(Lookup::$B,MATCH(Table 1::$D2,Lookup::$A,0))


Edit: I see that your region uses semicolons.

INDEX(Lookup::$B;MATCH(Table 1::$D2;Lookup::$A;0))

Fill down and fill right.


Now to colour the cells in Table 1-1: (text colour must match the cell fill to become hidden).



With Table1-1 selected, change the text colour of the table title to white. Then the title will not show, but it will occupy the same space as the title of Table 1.

Format Panel > Arrange > Back.

Now slide Table 1-1 underneath Table 1:



Not ideal; the cell borders do not match.

Perhaps another user will step in to help.


Regards,

Ian.



Change the formatting of a cell based on the value of another cell

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