How do I change the color of a column based on the color of other column?

cd3091

I am having trouble coloring cells in a column (if a cell D2 is light green, then B2 is colored light green). I have tried using conditional formatting, and looked at Changing Color of a column based on other column in put

However, I do not know what to put in formula to say that a cell D2 is light green. Let me know if I broke any rules here, and I'll fix.

Terry W

Apart from using vba, if you can tolerate the following:

  • manually refresh the conditional formatting for Column B each time you change the colour in Column D
  • save and continue to use your workbook as .xlsm (macro enabled workbook)

then try the following:

Please note I used the following sample data (starting from the first row) where Column A serves as Column D in your question:

Sample Data

In the Name Manager, set up a name called GetCellColour with the following formula:

=GET.CELL(63,$A1)

Replace $A1 with $D2 or the actual cell reference in your real case. This should be cell that will trigger the conditional formatting in B2.

Set a light green colour in cell A1, and in a blank cell say C1 enter the following formula:

=GetCellColour

In my example the colour code returned by the above formula is 35 for light green.

Highlight Column B (or the relevant range in Column B that you want to apply the conditional formatting rule) with cell B1 being the active cell, go to Conditional Formatting function to set up the following formatting rule:

=GetCellColour=35

Then your cells in Column B will be highlighted by light green colour if the corresponding cell in Column A is colored in light green. Please note, if you changed the cell colour in Column A, you need to go to Data tab to Refresh the worksheet to "update" the conditional format in Column B.

Here is a live demo:

Live Demo

For the use of GET.CELL function in the name manager, you can give a read to this article.

Let me know if you have any questions. Cheers :)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I change only certain column's color?

How to change bg color of column based on column values in HTML

How can I change the background color of a column based on the value of another column

How do you change the entire column background color of a grid column?

How do i write to next Column if Specific Column color changes

Wordcloud in R: color based on data in other column

pandas color cell based on value of other column

How do I change multiple values in pandas df column to np.nan, based on condition in other column?

Google Visualization How do change the background color column chart based on logic

how to change color of line chart in highchart based on a categorical column in r?

How to change color of line plot based on date column?

Change Color of the row based on column value

highcharts: column chart color change based on value

Pandas/Matplotlib: How do I plot in groups and color code based on another column?

How do I search Column O for a value listed on another sheet and change row color?

RDLC source code How to i change text color in table column

How can I change color of clicked cell AND next three in column?

Add a color column based on the values from other column

How do I change the values in one column based on a different column?

How do i change input field background color based on onclick?

How do I change the color of a row based on specific dates?

How do I change the color of an infobox in shinydashboard based on a string, not a value?

How do I set the stroke color for column charts within IcCube

How do I plot a color plot for using three column vectors?

How to color a bar plot based on colors in a column

How to set default color based on a column condition

how to color advanceddatagrid column background based on condition?

How to change color of a column in RDLC report?

How to change background color of bootstrap column