Working with Conditional Formatting and Multiple Rules - excel

I have two columns. 1st column is an expected completion date (ECD). 2nd column is a actual completion date (ACD), which starts out blank. I want the ECD to turn red if its date is in the past...easy. I want the ECD to turn back to white if there is an ACD filled in.
To me the formula would be: =AND(A3:A5 < TODAY(), B3:B5 IS NOT BLANK) But that formula is not allowed.
Can someone please help?

When you setup conditional formatting you have to be very careful about how you specify things. When setting up your formulas you only reference the 1st row of your AppliesTo range, excel will adjust the references as it moves down the range. Of course this will be different if you are referencing cells that are not in your first row. If referencing constants remember to use the $ for the rows/columns that don't change.
In this specific case the formula you want is: =AND(A3<(TODAY()),B3=0,A3<>0)

Related

Excel Conditional Formatting - Highlight blank cells between

thanks in advance for the help.
I'm making a Gantt chart in Excel and am trying to integrate the capability to highlight the work week (WW). The idea is that one can select the WW from a drop down menu and the corresponding columns in the chart are highlighted. I am struggling with the conditional formatting formula to highlight the desired dates.
Here's a screen shot of how the chart is set up
I am able to highlight the column of the cell containing the WW value (e.g. in picture column I is highlighted as it contains "WW42" in cell I3. I would like to be able to highlight the days from Sunday to Saturday of each WW.
Most formulas (that I know) work on the value of the cells rather than their location or index. I have tried simply filling in all the blank cells with the WW value and then hiding the value, but the formatting isn't aesthetically pleasing and it's not efficient.
I have also tried merging the WW cells, but am unable to select all columns of the length of the merged cell, just the first column associated. For example, if I merged I3 to O3, conditional formatting will highlight that merged cell and only column I.
Any suggestions on how to approach this is greatly appreciated!
Attached is a screenshot of my structure with my conditional formating working as required. You'll need to adjust acording to your structure, but I used a formula-based conditional formating, with the rule:
=COUNTA($B$2:B$2)=$A$1 //Where A1 contains the workweek I want to highlight
Entered into cells $B$3:$V$6. Of course, in your case you'd have to change it to something like:
=COUNTA($B$2:B$2)+41-3=$A$1
Since your work weeks start at 42 and you have 3 extra headings you dont want added on your sum (ACTUAL START, ACTUAL DURATION and PERCENT COMPLETE). Also the header for the work week has to be a numeric value, but you can play around this to get what you need. Let me know if you'd need further help.
You do not need to use the third row for your conditional formatting, if row 4 has legal excel dates. The WEEKNUM() formula gives you exactly what you need.
If your Dropdown Menu is in cell B2 and consists of numbers from 1-52 then this should work for your conditional formatting:
=$B$2=WEEKNUM(D$1)
See attached photo.

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.

(Excel) Conditional Formatting based on Adjacent Cell Value

I'm trying to apply conditional formatting in Excel on a range of cells, based on the adjacent cell's value, to achieve something like this:
The goal is to highlight values in Column B (Actual Expense) red if the value is greater than it's adjacent value in column C (Expected Expense). I've followed a number of tutorials that said to apply conditional formatting by selecting Conditional Formatting>New Rules>Use a Formula to Determine Which Cells to Format then applying a rule =$B4>$C4 which would format the 'Actual' cell red if it were greater than the 'Expected' cell. This works great for one cell, but not so well when I attempt to apply this to a range of cells. I've used the format painter as well as editing the rule to be applied over a range of cells (i.e. $B$2:$B$5) as shown below but it only bases the formatting on the initial formula (if B4 is greater than C4) and everything undesirably turns red.
I'd rather not make individual rules for every row. Is there a way to consolidate this into one rule?
You need to take out the $ signs before the row numbers in the formula....and the row number used in the formula should correspond to the first row of data, so if you are applying this to the ("applies to") range $B$2:$B$5 it must be this formula
=$B2>$C2
by using that "relative" version rather than your "absolute" one Excel (implicitly) adjusts the formula for each row in the range, as if you were copying the formula down
I don't know if maybe it's a difference in Excel version but this question is 6 years old and the accepted answer didn't help me so this is what I figured out:
Under Conditional Formatting > Manage Rules:
Make a new rule with "Use a formula to determine which cells to format"
Make your rule, but put a dollar sign only in front of the letter: $A2<$B2
Under "Applies to", Manually select the second column (It would not work for me if I changed the value in the box, it just kept snapping back to what was already there), so it looks like $B$2:$B$100 (assuming you have 100 rows)
This worked for me in Excel 2016.

Conditional formatting based on a value determined in each row in Excel for indeterminate amount of rows

So I've got a cell that I'd like to colour orange if the date in that cell (lets say that cell is C1) is later than a date in a cell (lets say B1) somewhere on that same row. I can conditional format C1 to do this. All good. But then I'd like to create an indeterminate amount of rows like this. The two dates which I want to compare are in the same column in every row, but are compared per row. So one date in C1 will compare to B1. Another in C2 will compare to B2. There doesn't seem to be a conditional formatting technique to achieve this. Help?
P.s: A few things I've tried is using If statements but I can't seem to work out how to do it. I've also tried conditionally formatting one row and then using "insert" to replicate the condition formatting of the row above it but this seems to start comparing the inserted row to the date in the row above...
In order to apply conditional formatting to a range you can select the range first (and then that range will automatically become the "applies to" range in conditional formatting)
....then set the formula that applies to the first row of that range only
....then select appropriate formatting
As long as the formula uses the correct relative references that's sufficient to make it work for the entire range
So in your specific case you can select the whole column, or a specific range like C1:C100 and then apply the formula that you need for the first row of that range, i.e.
=C1>B1
Another way to achieve this is to apply the formula to the first row only (as you have done already) then click on "format painter" (the little brush on the Home ribbon)......then select the range to copy to (e.g. C2:C100)

Resources