is it possible to use a formula in conditional formatting to change the fill color of one cell based on the fill color of another cell. All I can find is value based formatting. I have a large sheet that has many rows in one color with nothing in the cell and I want to change those cells to another color without having to select them.
You could use the Excel 4.0 Macro Function GET.CELL:
Returns information about the formatting, location, or contents of a
cell. Use GET.CELL in a macro whose behavior is determined by the
status of a particular cell.
Syntax
GET.CELL(type_num, reference)
type_num = 39:
Shade background color as a number in the range 1 to 56. If color is automatic, returns 0.
With cell B1 selected create a named range called FillColour.
This refers to: =GET.CELL(38,A1)
Now, if you enter the formula =FillColour in cell B1 it will show a different value when you change the background colour of cell A1.
NB: You may have to manually force a recalculation for it to work.
Next add conditional formatting rules: =FillColour=29 will be TRUE if the cell to the left of the CF is formatted as purple (RGB: 177, 160, 199).
Related
I am using conditional formatting to highlight a row if a cell has something entered and will remain highlighted until all cells in that row are filled.
=COUNTA($B$2:$E$1)>0
*Conditional format if true changes the cell interior to Yellow (B1:E1)
For each cell in the COUNTA, I use conditional formatting to change the cell to white if No Blanks.
This is making my conditional formatting cue huge. For each line, there is a conditional format to change to yellow with COUNTA, then each cell has a conditional format to change it to white when it has any data entered.
My question is; is there a better way to accomplish this without conditional formatting?
My goal is to have the sheet - each row - white. If any data is entered into any cell, it will highlight the entire row in yellow until every cell in that row is filled out making the entire row white again.
One formula makes it!
Keeping in mind you have headers in row 1, the region starts at row 2
=AND(COUNTA($B2:$E2)>0;COUNTA($B2:$E2)<4)
=$B$2:$E$35
So the problem I have is trying to change the fill color using conditional formatting in excel. This is basically what I want to do:
First I have a column, something like this:
1
1
1
2
2
3
4
4
4
Now I want to use conditional formatting to check if cell A2=A1, if it is to have fill color #1, and so on. Once it gets to cell A4 and it checks that A4=A3, if it does not match I want it to switch the fill to fill color #2, and it continues to check. Basically every time the cell does not match the value of the cell above, to switch to a different fill color.
I tried using the OFFSET function to check if that value was the same as the cell above, that worked but once I added the function to conditional formatting it went all funky and did not change colors.
Using your sample data, say you put them into cell A1 to A9, highlight cell A2:A9 only, and set up the conditional formatting as shown below.
For duplicated value you will use =A2=A1
For different value you will use =A2<>A1
select a cell outside of your table (let's say it's Z1) and fill it with the value: AB
cell B1 value: A
in all cells from B2 downwards: =IF(A2=A1,B1,SUBSTITUTE($Z$1,B1,""))
it means that if A2<>A1, B2="B"; if A3=A2, B3=B2="B"
fill all cells on column A with the color you want for "cluster" B: let's say it's blue
add "$B1="A" in conditional formatting, filling = red
How do I automatically have excel color code the cells in my table, to the legend I have in column I based on the text values? Is there a formula I can use to do this as I do know VB. I don't mind entering a new rule for each color as long as it pulls the correct text in column I and matches it to the table.
Table = Cells B2:F13 containing all text values
Column I2:I5 = text "YELLOW,PINK,PURPLE,BLUE" Fill color to be Yellow
Column I7:I10 = text "GREY,TAN,TEAL,MUSTARD" Fill color to be Green
Column I12:I14 = text "GREEN,ORANGE,RED" Fill color to be Orange
First select cell B2. In the Conditional Formatting Rules you will need to make 3 rules, one for each fill color. Select the 'Use a formula to determine which cells to format' option. Now we will use Excel's formulas to determine if the text matches the legend. Enter the following formula into the conditional format for B2:
=IFERROR(MATCH(B2,$I$2:$I$5,0),0)>0
That is the code for matching to the Yellow, Pink, Purple, and Blue keywords. This takes the value in the cell it applies to and looks for it in the legend referenced, if the match function finds the text it returns the location in the array, a non-zero number. If match doesn't find a match it throws an error, which we catch with the iferror function which converts it into a 0. Finally, we compare our result to 0 which gives us the true/false that the conditional format needs.
Note that the first reference B2 is relative while the match array reference is absolute. This way when we expand the conditional format to cover the whole area it updates the reference to apply to each cell, but not the reference to our legend.
For the other 2 colors simply adjust the match array to the other references.
Then the final step is to go into the conditional formatting rules manager and adjust the 'applies to' range to the full range instead of just B2.
I have two columns: In the first there might or might not be a value;
in the second column, if the first cell next to it is empty, I want to colour the cell in a grey colour.
Is there an easy way to change a cells background colour, if a different cell is empty?
Please select your second column and with Format, Conditional formatting..., Format cells if..., Custom formula is enter:
=isblank(A1)
and for Formatting style choose grey fill, Done.
Change "A" in the formula to the reference letter for your first column.
I really need help in Excel 2013, using Conditional Formatting (I think). I have a few worksheets that I need to draw data from in a summary page. In this summary page obviously I need to use colour, which I can do, but to further complicate things, I'm trying to find out that if a cell in, call it worksheet 2:
shows 1, the summary worksheet must not only change colour, but it must replace the number 1 with ship - cell colour green.
If the cell says 2, the summary page must say road, and cell colour orange,
if the cell says 3, summary page must say air and change colour to red.
Is there anyway that it can be done this way?
You need a combination of formulas and conditional formatting. Say Sheet1 has the summary and Sheet2 has the numbers you mention in cell A1. In Sheet1 you can use a formula
=CHOOSE(Sheet2!A1,"ship","road","air")
Use conditional formatting in Sheet1 to color based on the text the cell contains. Select cell A1 and create three formats that use formulas like
=A1="ship" -> Format green
=A1="road" -> format orange
=a1="air" -> format red
Is there anyway that it can be done this way?
Yes but, with this proposal, subject to there being content in summary sheet to begin with. 0 in each cell to be formatted would suffice. Say the formatting is to be applied to ColumnA, please select Column A and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
='worksheet 2'!A1=1
Format..., select Fill, green, and for Number, Custom:
"ship"
OK, OK.
As above ='worksheet 2'!A1=2, orange and "road".
As above ='worksheet 2'!A1=3, red and "air".
To hide any 0s that are not formatted, select ColumnA and Custom Format:
0;0;;
All the above assuming a one-to-one relationship for the rows between the sheets, so if A3 in worksheet 2 has 3, then that would trigger A3 in the summary sheet to be red/air.