I am trying to apply a formula to change color of both cells if they are not equal and if they are equal.
I tried conditional formatting in excel but it did not give me the required solution.
I want something like below:
please click to see the image
Thanks in advance.
I think you need to apply dollars in the conditional formatting formula. The dollars need to be in front so the formatting is applied properly.
Select the range you want to apply conditional formatting > Conditional formatting > New Rule > Use a formula to determine which cells to format:
And do it again but then with <> in between and make it red.
There you go.
Related
My conditional formatting rules I am using to highlight a row with value = 1 dont seem to be working because there is an existing formula in the cell. So I assume excel is seeing the formula but not the actual value and not highlighting it. Is there a way around this? I tried =$A2=VALUE(1) and it highlighted some rows but no the correct one.
You can do this by going to Conditional Formatting -> Rules to Highlight Cells -> Equals. Then, you enter 1 and select the preferred formatting.
I hope that I translated the menu correctly; I use Excel in the German language since it's my mothertongue.
I have a list of cell addresses (B1:B100) in one sheet, which refer to a range (A1:Z26, for example) on another sheet.
I have been trying to link these through conditional formatting (say, to light up red). By formula, I can have the following work...
=cell("address",a1)=B1 ; this makes the cell in the range refered to in B1 light up red.
But when I try to apply this to the whole list, as in =cell("address",a1)=B1:B100 it does not work...
Can anybody help me find a way forward here?
the issue illustrated
Slightly modifying your original formula, you could try:
=MATCH(CELL("address",A1),Sheet2!$B:$B,0)
I suggest you select A1:Z26, clear any existing CF from it, HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=MATCH(ADDRESS(ROW(),COLUMN(),4),another!$B$1:$B$100,0)
Format..., select red fill, OK, OK.
References in the B column should be relative format.
I've looked in to conditional formatting, but it doesn't manage relative references at all.
what I would like to write is something like
If ( the column number of this cell is more than the value in the first cell of this row)
colour it blue
end
It seems something really trivial, but writing something like:
=IF($C$3+4<=COLUMN();COLUMN()-4<=$D$3)
always returns true (I guess ecause it takes COLUMN as a fixed number, say the value it gets the frist time it calls it) and so all cells are blue.
that function returns the right value when evaluated inside the function field, but does not work for conditional formatting.
What can I do?
Assuming you want something like this:
Select Columns A:H and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=COLUMN()>$A1
Format..., select choice of formatting, OK, OK.
You can do this with the normal conditional formula itself. Perform the following steps.
Click on a cell, the first cell that you wanted to color. Say it is C3
Now the default cell becomes your cell C3.
Click on Conditional formatting options, in that, select "Manage Rules"
In Conditional formatting rule manage window, click on New Rule button
In the new formatting Rule window. select Use a formula to determine which cells to format
Enter =(COLUMN(C3) > $A3) in the Format values where this formula is true edit box
Select the required color and click ok
Now copy this cells to all other cells where you want to do the conditional formatting.
Here the step 1 and 2 are critical to ensure that it is relative.
Quite hard to understand what you want without having more informations. Be that as it may, note that
=IF($C$3+4<=COLUMN();COLUMN()-4<=$D$3)
Means
if $C$3+4<=COLUMN() return COLUMN()-4<=$D$3 otherwise return FALSE
If it always returns TRUE it is because the tested cells are between the $C$3+4th and the $D$3+4th columns AND that $C$3 - $D$3 is a positive number which is sifficiently large for not beeing exceeded by the column number of the cells you test.
I am trying to write a rule in vba to trigger a Conditional Format, but I have my doubts if I am writing it correctly.
The condition for the format would be, if the cell value of a range is equal to the cell value of the same range on a different sheet:
=M7=Original!M7
This is to applied for all cells in a range (M7:BZ5000) [5000 is a large outer bound number to help conserve memory].
The issue that has me perplexed is how do I tell vba that M7=Original!M7, M8=Original!M8, Z143=Original!Z143, etc.
I feel this is a pretty basic concept but I searched these forums and could not find an answer that I think applies to my issue.
Also, Since I Would want this conditional format to trigger at the press of a button, how would I tell it to deactivate, WITHOUT removing the rest of my conditional formats (I have normal conditional formats applied to the range and want them to remain whenever the button isn't pressed.
Sheets("Main").Select
Range("M7:BZ5000").Select
For Each Cell In Selection
If Cell.Interior.Color = Excel.XlRgbColor.rgbBlack Then
Cell.Clear
End If
Next
You are using the conditional formatting choice of "Use formula to determine which cells to format"
The formula you will need is going to be like this (note the use of $ signs to control how the formula changes. The $ stops the value after it from changing)
=AND($M7=Original!$M7,$G$4="Y")
Note $G$4 is a cell you can use to turn on and off the cond. formatting. When it is "Y" the formatting will work, otehrwise any formatting you have applied will JUST be shown.
If you don't want you formatting to show when conditional formatting is on, then your conditional formatting MUST have formats the remove yours and sets them to the "default" settings.
I am stumped at what should be a simple matter. I have this formula in a column of cells:
=IF(ISBLANK(BG7),"",IF(BG7>=70,"OverBought",IF(BG7<=30,"Oversold","Neutral")))
The formula works and the cell shows the correct word.
I would like to apply conditional formatting to the result of the formula
green for Oversold
red for OverBought
yellow for Neutral
I have tried every variation I can think of for "Value of Cell" with and without quotes, "Enter a Formula" etc and no dice. What am I missing?
I used your formula, selected the cells, and used the menu "Conditional Format", then first option (something like "highlight cells"), then forth option ("equal"), then typed Oversold with no quotes and anything else, then selected a format option.
Then i repeated the same steps for the other values (Neutral, OverBought), selecting different format options.
It worked.
This set of rules work for me:
Go to Conditional Formatting > New Rule > Format only cells that contain > Cell value Equal to Whatever.
Admittedly I use Excel 2013, not 2010 as in your case, but I'd be very surprised if there is much difference for conditional formatting rules like these.