Format a cell that is referenced by another cell - reference

I need to format a cell that is specified by another cell. Basically after many calculations, the cell AL1 contains a cell reference, in this case it is AD48. I want to format cell AD48 and fill it red. This cell reference can, and will change so tomorow it may be AD54. I would then want only cell AD54 to be filled red and not AD48 anymore.
So basically whatever cell is specified in AL1, I want to format that cell (in this case fill it red)
ALOT of googling and no answer. Any help much appreciated!

Select sheet (click triangle immediately to the left of ColumnA and immediatley above Row1), Home > Styles - Conditional Formatting, New Rule, Format only cells that contain, Cell Value equal to =$AL$1, Format, Fill, Red, OK, OK.
Edit following clarification of requirement:
Change to Use a formula to determine which cells to format and apply
=SUBSTITUTE(CELL("address",A1),"$","")=$AL$1
Edit to add image of part of file uploaded by OP and some CF clarification.
Edit OP has an answer that works but posted this as a link in a comment. There is a solution that does not require formulae in AH1:AJ4 now that AA3 contains =TODAY():
=OR(AND($C5=TEXT($AA$3,"mmmm"),C8=DAY($AA$3)),AND($C4=TEXT($AA$3,"mmmm"),C7=DAY($AA$3)))
in Format values where this formula is true: and Applies to =$C$7:$AG$125. (Now formats both day of week and date of month).
Edit. Attempt at clarification (that should have been provided before!)
Selecting C7 as the start point, the formula for conditional formatting checks whether A or B is true:
A] Both the month name (in C5) matches the current month (long form) of =TODAY() in AA3) and the cell immediately below (ie C8) matches the day in AA3,
Or
B] Both the month name (in C4 – that is merged with C5) matches the month and the current cell (C8) matches the day in AA3.
Either case triggers the conditional formatting – hence this is applied in pairs of vertically adjacent cells.
Since the spreadsheet is well laid out (each month 11 rows and Day1 always in ColumnC) this same formula can be applied throughout with the nature of conditional formatting taking care of adjusting the relative references to cells in ColumnC up to the specified limit of Row 125 and in Row7 (or 8) for columns up to the specified limit of AG.

Related

How do I apply conditional formatting to an entire column based on the previous rows value?

I am trying to create a worksheet which colour codes the cells according to the next date. If the value of 1 July is higher than the value of 30 June then the cell of 1 July needs to be green but if its lower then it needs to be red. This would then apply to all dates in my worksheet according to the previous days value.
I am unsure how to apply conditional formatting to an entire column based on the previous rows cell value and not one single cell value
The conditional formatting will be applied when the criteria result = TRUE.
Here is the formula to enter into the conditional format window to result in a RED cell. Green would be the same, but with a greater than symbol. Click on the first cell that should be conditionally formatted, then create the conditional format rule and check it. Then copy the cell, highlight the range of cells to be formatted and paste-formatting only.
Note, in your explanation you mention that a lower value than the prior day should be RED, but the image shows GREEN. You can reverse the formula below based on the output that you need.
=AND(ISNUMBER(B2),ISNUMBER(B3),B3<B2)

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.

LibreOffice highlight cells if they are the same as a specific range

Master and Step Chart
Hello, I'm using A4-E4 as a "Master" code, and incrementally using A5-A8 to replace A4, B5-B8 to replace B4, etc etc first replacing one number of the "master", then two different numbers, etc until I have basically every combination. At some point the same number as the "master" is going to be generated. I have the numbers separated into groups of 16 on individually sheets for a total of 64 sheets. Obviously at some point the same number "43254" is going to generate on one of the sheets. Is there a way to search/highlight that number automatically upon generation? I've found that I can do conditional formatting to search for a specific cell, but not a range of cells. Like compare "A4-E4" to every set of five adjacent numbers in all the sheets, then highlight it. I have no idea if this is possible, but I'd appreciate it.
Select cells A4 through E4 and go to Format -> Conditional Formatting -> Manage. Apply style Good if Formula is:
CONCATENATE($A4;$B4;$C4;$D4;$E4)="43254"
So 43254 matches.
And 43253 does not match.
This is more complex than first appears. The following explanation may be difficult to understand if you do not have much experience with conditional formatting.
The formula gets evaluated 5 times, once for each of the cells.
Normally, rather than always indicating cell A4, Calc would interpret A4 as the currently evaluated cell (because we selected cells starting from A4). And B4 would indicate the cell to the right of the current cell that is evaulated. So for example, if such a conditional formatting formula were filled to cell D7, then A4 would actually indicate cell D7, and B4 would indicate cell E7.
However, our formula uses $A4 instead. The $ tells Calc that we always want column A even if the formatting is for column B or C et cetera.
One outcome of this is that the formula can be filled down or up but not left or right. If it is filled down one row for example, $A4 refers to column A but the current row, which would be cell A5.

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

(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.

Resources