Autofill conditional formatting cell references - excel

Excel conditional formatting fill down is working but not recording the correct formula once filled down.
eg. Cells in Column B (eg B6) have a value (active, exit, suspend). The adjacent Column C cell needs to be colored green if the adjacent value in column B shows the entry active. This works fine when using in C6 Use a formula to determine which cells to format, and Format values where this formula is true shows =B6="active" and cell C6 comes up filled with the green color.
Upon fill down from cell C6 the formatting is all displayed correctly for each additional instance of the word active in a column B cell. However when the conditional formatting rule is viewed for a cell such as C7, C8 onwards instead of showing =B7"active" or =B8="active" etc they still all say =B6="active".
Does anyone know why they do not refer to their relative adjacent cell (B7, B8, B9 etc) instead of the original B6? The formula originally was =$B$6="active" and has been edited to remove the absolute reference and replaced with =B6="active" to allow a relative fill down.

Does anyone know why they do not refer to their relative adjacent cell ( B7, B8, B9 etc ) instead of the original B6 ?
Presumably someone in Microsoft does and that is not the answer you seek.
However you acknowledge the formatting is working so it hardly seems to matter.
I can suggest that it is efficient. Conditional Formatting with a formula has three key parts:
Formula
Formatting
Range
Formula
May be complex and lengthy.
Formatting
It is what it has to be. Usually a very simple fill colour but sometimes bold, font, font colour etc.
Range
The 'neglected' one of the three but equally important though simple - just co-ordinates defining one or more rectangles (or a singe cell reference otherwise the top left and bottom right references). An efficient way to define an area that works whether one cell or one million, still just two corners at most.
You have probably noticed that whatever you enter there that is valid, anchors ($ signs) will be added where not already provided. You may also have noticed that Applies to will accept a named range - but Excel then automatically converts this to the cell reference/s.
It might help to consider what you would do if you were in charge of having doors painted yellow at house numbers 1 to 10 on a housing estate (yellow highlighting probably the most common format chosen for Conditional Formatting and a cell being roughly the shape of the surface of one side of a door). Say during the process you were required to extend that to house numbers 11 to 15 also. Would you then produce five additional copies of the painting specification (the formula), it might be several pages long, or would you merely change your instructions to the team doing the work from "do this for houses 1 to 10" to "do this for houses 1 to 15"?
As you copy down the Applies to range adjusts accordingly, the system works. But for each rule there is only one range and that is the case in reverse, for each range thee is only one rule, So no need to express that rule cell by cell, hence perhaps a million times over.

Related

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.

Excel Conditional Formatting Rows with Formula unique to each row

Photo of Spreadsheet
What I'm basically trying to do is have the cell E15 turn red when the percentage in J15 is less than or greater to 20%, and the cell K15 has the text: Plate.
I also want this effect to happen with all the cells in E15-E34, but for them to be based on their individual row. So, for example, E18 would turn red when K18 says: Plate and J18 is less than or greater to 20%. I don't know if I'm just going about this the wrong way, but if not, then how can I achieve what I need to?
I've tried removing the $ but they automatically reappear, any help would be greatly appreciated. See conditional formatting formula below. Photo of spreadsheet at beginning of text.
=AND(K15="Plate",J15>=20)
Column K is a selection of either Plate or Stiffener and Column J is a percentage based off a calculation of another cell.
In my above photo, I have setup a conditional format with two actions (ignore my values in the photo, and follow these steps).
First, Select Cell K15 to K19 (it is important to start at K15, or else you will have to modify the formula below).
Next, add a Conditional Format formula (below). Any cell reference within this formula MUST be relative to the K15 cell.
=IF($K15="Plate", AND($K15="Plate",$J15>=0.2), AND($K15="Stiffener", $J15>=0.25))
You could also use this bit of code which is much more flexible, as you can expand the number of items.
=OR(AND($K15="Plate", $J15>=0.2), AND($K15="Stiffener", $J15>=0.25))

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.

How can I make an "offset" reference to a cell based on the results of an "if" in a different cell

I am trying to pull the value of a cell into a summary chart but I need the cell it pulls from to be dependent on where the adjacent cell is pulling from.
Here is a simplified version of what I'm trying to do.
imagine a row of 5 cells j25:n25
depending on the results of an if evaluation, j25 will either be equal to f10 or i10.
k25 needs to be equal to the cell 3 columns to the right of the cell that j25 gets its value from... in this scenario either i10 or l10
l25 needs to pull from the cell 3 columns to the right of the cell that k25 pulled its value from ... in this scenario l10 or o10
and so and so on.
After doing some research it looks like I might be able to do this with the formulatext function if I had excel 2013, but I'm still on 2010
Any suggestions? Thanks
For Excel 2010, if you're willing to hide a helper cell somewhere, it can be done as follows. In the pics, the green cell tells which cell should go into J25. The yellow cell just contains the corresponding cell address. Unfortunately, to do this you also have to keep J26 in sync with J25 (same cell addresses).
The results look like this:
The values J25 - M25 all change depending on the value of F1. Additional cells are just a matter of dragging M25 to the right.
For easy reference, the formula in K25... is =OFFSET(INDIRECT($J26),0,(COLUMN()-COLUMN($J25))*3)
You could format J26 so it isn't visible and/or put it in a different part of the worksheet altogether.
As an aside, it looks like it could be done in 2013 with FORMULATEXT as you thought.

Excel Conditional Formatting Probsss

I am using conditional formatting in Excel to compare two sets of data (set 1 in column A and set 2 in column D). The conditonal formatting is in column F so if column A=D then column F will turn green and if A /= D then column F will turn red.
The problem is when I delete the first cells in A and D and shift all the cells below up, the whole conditional formatting gets erased. Is there a way to keep that conditonal formatting permanent?
[Im having trouble uploading pics for some reason...if I could, I would include a pic so it's easier to understand what's goin on]
This is a general feature of Excel, not just of conditional formatting. In short, Excel tracks each cell as a unique object, and if it gets moved around (like a row is deleted), then it automatically shifts the reference to that object to refer to its new location.
Hypothetical Example
Consider a formula in cell F5, which says '=A5+D5'. If you rightclick on A3, delete that cell and shift cells up, the formula in F5 will now read '=A4+D5', because the old reference to A5 has now shifted upwards by 1.
You can theoretically solve this by using the INDIRECT function. In the example above, let's say you wanted to delete A3, and then you wanted the cell in F5 to still read '=A5+D5', even though the old A5 had shifted up. You could do this with the following formula:
=INDIRECT("A5")+D5
Because you are indirectly referring to A5 by explicitly writing it out as a text string, it won't move around when rows and columns change. Be warned that this is often counter intuitive. If you insert a new row above row 2, for example, your formula would now read:
=INDIRECT("A5")+D6
Note that D6 automatically shifted, but INDIRECT("A5") did not. This is likely not the desired result. However, if we assume that you will often be deleting (and shifting up) cells in column A, but you want all other worksheet changes to be incorporated, we can do what you want. Again ignoring your specific question for now, consider the above example. How can we change it so that when a whole new row is added, the formula ultimately becomes A6+D6? But at the same time, when A3 is deleted, have the formula now read A5+D5? In short, we do this by referencing the row that D5 is on, as follows:
=INDIRECT("A"&ROW(D5))+D5
Now, if a whole row is added, both instances of D5 in the above formula become D6. But if A3 is deleted, the "A" remains "A", and the D5 instances remain D5.
Actual Solution for your case
In your conditional formatting therefore, the formula would be as follows [Applied to all of column F, or however much of column F you want, starting with F1] [two rules one where A<>D and one where A=D; or, make formatting GREEN by default and have RED only apply where A<>D]:
=INDIRECT("A"&ROW(D1))<>D1
The cause of this problem is likely that the cells you deleted were referred to in the conditional formatting syntax. For instance, if you have a conditional formatting, applied to cells F1:F5 with the formula =$A1=$D1, and then delete cells A1:A3 and D1:D3 (shifting cells up), you will notice that the conditional statement is now only applied to cells F3:F5. Excel tries to update these references for you, but occasionally that isn't what is desired.
Using a formula that doesn't directly refer to the cells will fix this. For instance:
=OFFSET($F1,0,-5)=OFFSET($F1,0,-2)
and
=OFFSET($F1,0,-5)<>OFFSET($F1,0,-2)
Now, when you delete any cells in columns A or D, the conditional formatting will still be applied to all rows.

Resources