Excel Conditional Formatting Self Reference - excel

I'm trying to do some conditional formatting in Excel 2003, what I want to do is have a cell go red if the next cell is "Yes" and go bold if it, itself, contains "Yes". So if both cells are "Yes" the current cell will be red and bold. I want to do this for a group of cells so I haven't used a direct reference to the cell, but I have come up with the following.
=AND(INDIRECT(ADDRESS(ROW(),COLUMN()))="Yes",INDIRECT(ADDRESS(ROW(),COLUMN()+1))="Yes")
But this always fails. However, if I use either on its own (INDIRECT(ADDRESS(ROW(),COLUMN()))="Yes" to make the current sell go bold), it works.
Does anyone know how I can self reference a cell generically in excel 2003 conditional formatting?

I don't have Excel 2003 to test on, only 2007. However, I think you can solve your problem with the following rules. Assume that your first column is A and the second is B with the first data value in A1.
First rule on A1 is highlight using a formula of =and(A1="Yes",B1="Yes") and the format is bold text and red background.
Second rule on A1 is highlight using a formula of =B1="Yes" and the format is red background only.
Third rule on A1 is highlight when cell equals "Yes" and the format is bold text only.
Then copy this format to all the other cells in column A with the format painter. Excel will automatically adjust the cell references for you so that in A2 the formula refers to B2, in A3 it will refer to B3, etc. Note that the order of the rules is important because Excel 2003 will stop after the first rule that matches. That's why you can't get the behaviour you want with only two rules.
You can also copy the same format to column B, assuming that's what you want. Otherwise, format B1 with the rule to bold when cell equals "Yes" and copy that to the rest of column B.

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 :)

Conditional Format in Excel 2016

I am trying to right rules for a spread sheet containing the NFL season. I have it set up so that I have a week in one column. At the bottom I have a cell for selecting the one team I am picking that week. When that cell is empty, I want nothing to happen to weeks 2-17. When I put a team name in that cell, I want that team name to change color with a line through it for weeks 2-17.
So far I can make the rule for the last part but when I leave the cell blank, week 2-17 all change color with a line through it. I can't figure out how to get the blank cell to trigger no action
Any time I tried formulas with =ISBLANK($B$50) in it I was unable to trigger the rule as nothing I added to it from what I seen from googling/youtubing it worked. The only conditional format I have that works is Format only cells that contain =$B$50 which applies to =$C$2:$R$48
Keep in mind I am slightly above beginner with excel formulas/rules
If the cells change their format to something with a line through it, this is either a conditional format or the regular format of the cells. In either case, remove that format.
Then select the cells that you want to format and create a new conditional format with a rule that uses a formula. In the animated screenshot I am formatting the cells from D3 to F7. Select D3 to F7 and make sure D3 is the active cell. Then use the formula
=D3=$B$7
and set a format. Note how the reference to the cell to format does not have $ signs, but the cell where the comparison value is entered DOES have $signs.
If the cell B7 is blank, no conditional format will be applied, just the regular cell format will show.
Here is a screenshot of the Conditional Formatting Rules Manager.

How to get Formula Behind Conditional Formatting in Excel

How can I get formula applied behind conditional Formatting for highlighting Cells?
Conditional Formatting is applied based on text in each cell of Test Result column(third column).
Formulas List:
Purpose is to reuse (copy paste) the formula in other sheets.
The formula is shown in your first screenshot. The dialog has the formula in the column "Rule applied (in order shown)". These rules use the out of the box settings to format cells based on their values, so the "formula" is not accessible for editing.
But the format can be copied to other cells very easily.
Here are the steps:
Select the cell with the conditional format and copy it
click the cell where you want to apply the same format
use Paste Special > Format to paste just the format to the selected cell
Edit: If you don't use the built-in conditional formats but instead select "Use a formula to determine ...", you can construct the formulas manually.
There is no automated way to convert the existing out-of-the-box rules to fomulas. You will need to use your human understanding of the logic and appy this to formulas. So, for example, if the selected cell is H3, you can us this formula
=H3="Fail"
and format the cell with red font and light red background. Note that there are no $ signs in the reference to the cell H3. If you copy that format to another cell, it will apply to that other current 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

Excel 2011 copy formula/rule headache

I'm trying to set up a formula or rule (don't know which is the best to do this) on excel 2011. So for cell A1, I want to type in a value. I want cell B1 to show it in green if the value is more than A1 or red if it's less. 1) I also want to copy this formula or rule down column B so that it will change according to the value in column A (A1:B1, A2:B2, A3:B3, etc). If possible, I also want to copy this formula or rule to columns C, D & E so that if the value in cell C1 is greater than the value in B1, it will turn green and red if it's less, etc.
Thank you in advance.
What you need is Conditional formatting.
Steps to perform:
Click a cell
Go to menu: Format -> Conditional Formatting,
Choose formula based formatting.
Edit based on your formula
You can use the copy formatting icon to copy this conditional formatting to the whole column

Resources