Conditional Excel formatting based on another cells value - excel

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.

Related

Conditional formatting many cells by individual formulae

I want to apply a conditional formatting (CF) rule to a group of cells to individually colour them if their individual cell values are greater than a threshold (in this case >=5). To illustrate:
The top row shows how I want the bottom row to look. For the bottom row I cannot figure out how correctly format according to cell-specific formulae.
The problem is identifying a way to specify cell-specific CF formulas in a single operation for a group of cells - as you can by pasting/dragging normal cell formulas. I obviously don't want to have to manually specify the formula for each cell!
Grateful for assistance.
Select the rows or columns or range that you want to conditional format,
Enter the below formula in the formula bar in conditional format and choose a fill color,
=AND(A1>=5,ISNUMBER(A1))
If you are starting in row3, change the A1 to A3. The $ that you have in the formula makes it absolute. It should be relative.
You just select all required cells to format. Then go to conditional formatting.
Check what is the cell shown just before the formula bar (the single cell that represents the selected range, also called default cell) and use that cell in your formula without absolute reference. like B3>=5 or R3>=5

Conditional Formatting for a row when there is a text disagreement between two cells

I'm working on a conditional formatting issue. I would like the whole row to highlight if the text in the same row in columns B and C disagree. So far, I've been able to write conditional formatting rules that leave the cell un-touched if there is no data and if there is a data entry that disagrees with the text in Column B, but I can't seem to get the formula to apply to the full row.
Here is what I currently have:screenshot of the document with conditional formatting rules visible
I'm working on Excel 2010. Maybe there is a way to use a logic formula?
I look forward to hearing suggestions!
You can do this with a formula. Highlight the range you would like to format, create a new conditional format, select "Use a formula..." and enter the formula as it would apply to the first cell or in this case row.
In my case, I chose the first 6 rows: $1:$6 as my range. So in this case, I would enter the formula as if I were only entering it for my first cell. The formula =$B1<>$C1 will check for inequality between B1 and C1 in the first row, B2 and C2 in the second row, and so on.

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 formatting based on reference cell value for each cell in row

I would like to color cells in each row based on the value of a cell in the same row and then do the next one.
How do you set the formula to be able to color the cell if not equal to a reference cell on the same row?
So I just want to change the color of a different cell than reference cell which will have a different value for each row.
In Excel you will need to create a formatting rule, within the modal select the option that you want to use a formula to decide what cells to format:
Within the edit box you can type the formula that is used. The formula in the example will check whether the value of the 1 cell in the column is not empty. If this is true, the cell will be formatted as specified in the format preview.
Mainly using the ROW and COLUMN functions in Excel you can get access to the current Row and Column of the Cell for which the formula is executed.
Given the input:
Select Cells B2:G6 and click on Conditional Formatting
Your prompt will look different on Windows, but the important part is "Use a formula to determine which cells to format" The formula is =B2<>$A2 Please note the lack of $ because it needs to be flexible (except for the reference cell column which in my case is A)
Final result is:
Conditional formatting foes not need to operate on the cell you are formatting. Using a mixture of $ and non-$ formatted formulas, you can set highlighting accordingly.
Note to make sure this works correctly, highlight the area to be formatted first, and note where you start. e.g. If I wanted this to apply to A2:A50, then I would highlight A2 first, and make the formula reference row 2.
Also, note that you will have to type in the formula. Any clicking of cells will automatically put in $ signs to fix the comparison to that specific location, which is not the behavior we desire
e.g. To format A2:K50, when the H value in that column is 7
Highlight A2:K50
Conditional Formatting -> New Rule -> Use a formula
formula would be =($H2=7) <- this will fix the column to be H, and vary the row accordingly
Format as desired
e.g.2. To format based on previous cell
Highlight A2:A50
Conditional Formatting -> New Rule -> Use a formula
formula would be =(A2<>A1) <- this will check the row above each time
Format as desired

Resources