Adding a new rule in conditional formatting? - excel

Table Context:
I currently have an excel sheet that looks like this:
.
The sheet is full of formulas that pull relevant course information from another tab.
Moreover, I have set conditional formatting rules so that each course number (B8XXX) is given its respective color. You can see an example of that here:
My Question:
I am trying to set a conditional formatting rule such that the adjacent cells that display "OPEN" correspond to the length of a class by removing the text "OPEN" and applying the same color as the course.
To be more clear, here's an example:
^ Here the class length is 1.30 hrs, but the cell doesn't span over to the 10:30 time slot in cell C3.
I want to apply a conditional formatting such that cell C5 reads the "Class Length: 1.30 hrs" in cell B5 and removes the "OPEN" text, and applies the same color format in cell B5 to cell C5. So, cell B5 AND cell C5 are the same color blue.
But I also want the conditional formatting to read the class length for classes that span 3.15 hrs, so that it spans across 10:30-12:15. So, (below) , the orange formatting should be applied to cell C11, D11, and E11.
EDIT: Course Information
The course information is pulled from another table below it, which is pulled from a tab that has filtered a bunch of data.
Conditionally formatted table:
Table below it:
The tab where the information is coming from is:

Related

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

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.
Like I said many times before: Color is not data. There is no worksheet formula or conditional formatting rule that can evaluate the color of a cell.
The reason or logic for that manually applied color is in a person's head, but not derivable from data in the spreadsheet.
Use real data in the spreadsheet if you want to use conditional formatting or worksheet formulas.
If you want to evaluate cells by their color and apply that same color to another cell, you will need to use VBA.
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:
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:
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 :)

Multi-conditional conditional formatting question

I am currently applying conditional formatting to a table.
I have a rule that states if a certain cell in column B contains a course that begins "B6", then excel needs to color the adjacent cell in column C, blue.
The thing is, the column that would contain B6 changes depending every semester since the courses also change. So for example, a course that starts with "B6" in cell B5 may very well change to a course that starts with "B80" in the future.
That said, to combat potential changes I am going one by and adding conditional formatting formulas for each row/cell.
Here is an example:
Conditional Format Formula - Here you can see that if cell B4 contains "B6" it should format accordingly -- at this time it does not have "B6" so it's blank. On the other hand, B5 contains "B6" so it should format accordingly -- which it does in this case.
Formatting Outcome on the Sheet - this is what it looks like on the sheet.
My Question
So as you can see I am going one by one and applying the conditional formatting to each cell one by one. I have to apply the color blue if each cell contains "B6", and the color orange if each cell contains "B80" and so forth. Is there anyway I can make a formula so that I only have to make one rule per color for each column instead of conditionally formatting each cell?
EDIT:
Update with relative referencing - I followed your link and it didn't seem to work.

Conditional formatting: automatically refer to the next cell?

I have a schedule with team member names and the column headers are half hour time intervals. I want to shade the cells of hours each person does not work with gray according to their shift schedule, so that I know not to schedule that person during that hour.
I have created a separate table with each person's shift schedule, and the names appear in the same order as in the schedule.
Is there any way to conditionally format the cells at once? There has to be an easier way then what I am doing now...which is one by one clicking on each person's cell and creating the formatting formula.
I can't copy paste the formatting because the formula still refers to the previous person's shift on the other table. I need it to refer to the next row.
The formula I use for conditional formatting is:
='Job Functions'!$O$5>$C$9
Where Job Functions is the sheet that contains the shifts, O5 is the shift assigned to that employee, and C9 is the column header on the schedule (6:30am). I just clicked on the cell and created a new conditional formatting rule from the excel ribbon on top...no vba.
If there is a VBAsolution to this that'd be great! I'm fairly new to VBA
Conditional formatting works like this
Let's say I have an array of numbers in A2:E5 and a header row in A1:E1. I want to have my array of number be green if the value of the cell is greater than it's column header. That is to say I want to compare A2>A1, B5>B1, D4>D1, etc. this means I want the header row comparison to be constant.
In Excel formulas you use the $ symbol to maintain constant references. Since I want the row to stay constant but I want the column to be relative to the cell in my array of numbers my header reference will be A$1 (column is relative, row is locked).
This is just the formula used to determine if formatting will be applied or not. If it returns true then the conditional formatting is applied, if it returns false then nothing happens.
However, where the formatting is applied is determined by the Applies to reference. In my example below I am applying the formula A$1<A2 to $A$2:$E$5. This means that in the cell A2 the formula A$1<A2 is used to determine if formatting is applied, but in B3 the formula B$1<B3 is applied. This is the same logic as if you were to have dragged the formula itself into these cells.
If instead my Applies to formula were $B$2:$E$5 this means that B2 would be colored green if A$1<A2, and B3 would be colored green if A$1<A3.
So with all that your formula should probably be
='Job Functions'!O5>C$9
drag and drop it down to fill the other cells

Conditional formatting for a column based on the value of header

I have several columns where the data from rows 7 onwards changes depending on the selection made from a dropdown menu in row 6. Most of these options will result in textual or number based values appearing, but two of them would need to be formatted as currency.
Essentially what I want is a conditional formatting formula that says; if row six in any column has a value of “Implied Unit Rate” or “Annual budget”, format rows 7 and onwards in that column as currency.
I can get this to work by creating two separate conditional formatting formulas and applying them both to the whole area, but it seems like there should be a way to do it in a single formula.
My current formulas, applied as two separate rules:
=INDIRECT(ADDRESS(6,COLUMN(),1))="Annual Budget"
=INDIRECT(ADDRESS(6,COLUMN(),1))="Implied Unit Rate"
How I think it should work when applied as one rule:
=OR(INDIRECT(ADDRESS(6,COLUMN(),1))="Annual Budget",
INDIRECT(ADDRESS(6,COLUMN(),1))="Implied Unit Rate")
When I enter the combined formula in a regular cell within the worksheet, it does return true as expected, but does nothing when I apply it as a conditional formatting rule. Any ideas? Thanks in advance!
Now I may be mis interpreting what Scott is saying, so I am going to say this in my own words.
Your condition check on the cell address in question is a little "verbose". In order to apply your conditional formatting, select the range you want to apply your condition formatting to first. Lets arbitrarily say select range A7 to D42. After selecting the appropriate range, ensure cell A7 is the active cell of the selected range. This usually means there is a border around A7 to D42 and all cells but A7 have been slightly greyed to indicate that they have been selected, and A7 will have a brighter background to indicate that it is the active cell. With all that still in effect, select your conditional formatting.
In conditional formatting choose formula as the option (last one at the bottom) to control how your formatting will be applied. In the region where you can enter your formula, enter the following:
=OR(A$6="Annual Budget", A$6="Implied Unit Rate")
The $ will keep the row and column reference from changing as it is applied to each cell in the range. It will always be checking row 6 of what ever column the cell is in. The column A reference is relative to the active cell.

Conditional Excel formatting based on another cells value

I want to take a cell and format it based on the value of another cell. For example
I want to from A23 based on the value of C23 but when I select A23 and ass this formula it only formats D23. Also is there a way to duplicated this easily for 29 other rows? A22/D22 for example.
="D23<1%"
Select all of the cells you want to apply the conditional formatting rule to with the cell in the top-left as the active cell. Note the row of this cell. For the sake of argument, I'll say this is row 22.
Clear out the previous attempts at a conditional formatting rule and start a new one. Choose Use a formula to determine which cells to format then supply the following in the Format values where this formula is true: text box.
=$D22<0.01
Note that I've used row 22 in this formula. That should be changed to whatever row your block of cells to receive the CF rule starts with.
Click Format and select some formatting. Click OK to confirm the formatting choices and then OK again to create the new rule.

Resources