excel conditional formatting on cell versus adjecant cell - excel

I have two columns with names.
I would like to change color on the corresponding cell where value is not the same as in first column.
A B
1 Lars Lars
2 Erik Erik
3 Niels Jens
4 Brian Brian
In the above case B3 should be highlighted.
I have looked all over (really - all over) the internet - and the closest I got was Column A to be highlighted if there was a difference.

You can use formula in conditional formatting. I have used VLOOKUP You can use MATCH as well
=ISERROR(VLOOKUP(B1,$A:$A,1,0)<>B1)

My approach would be to select column B, go to Conditional Formatting > New Rule > Use formula to determine which cells to format, and then I would put in the following formula:
=D1<>C1
Please, note that this is without dollar signs, this is very important.

Related

Excel Rule: Mark both cells (but only them!) in yellow when their difference is greater than 14. Tried my formula but not working

I have 2 rows with dates and I want to mark both dates if the difference between them is greater than 14 days.
Example:
D E
14.03.2018 15.03.2018
14.03.2018 21.04.2018
14.03.2018 28.03.2018
14.03.2018 21.03.2018
Formula: = (E1-D1)>14
Format: infill yellow.
Applying it to the whole ROW E.
Problem is, that when its True then the whole row gets turned yellow, not the Cell in E.
Any ideas?
Probably, you have applied the conditional formatting in one cell and then copied format in entire column. Please select the entire column first then apply the formatting as described here.
I am getting following
In the Conditional Formatting Rules Manager change Applies to into:
=$E:$E

Conditional Formatting using vlookup

I have Sheet 1 as
AssocNum RatePlanCde RateType RateTypeDesc
272 911 2 Adjustable
472 1115 2 Fixed
Many of these RatePlanCde are not valid anymore. These have been highlighted in red in Sheet 1. For example, 911 is not a valid RatePlanCde, while RatePlanCde 1115 is still valid.
I have sheet 2 as
AssocNumEID RateCostComponentCde RatePlanCde ReadOnlyInd
272 2 911 Null
472 4 1 Null
I need to find the rows in Sheet 2 where the RatePlanCde is invalid and highlight those rows. Any help in doing this using conditional formatting with VLOOKUP will be appreciated.
UPDATE:
Updating to add more details.
I tried the COUNTIFS solution proposed here but for some reason it is not working for me. What am I missing?
I have added a helper column to Column B of Sheet1 (aka RatePlan) that includes either Valid or Invalid for the corresponding RatePlanCde column (Column C).
I am using this formula under conditional formatting in Sheet 2 for conditional formatting:
=COUNTIFS(RatePlan!$B$2:$B$2514,"Invalid",RatePlan!$C$2:$C$2514,$C2)>0
I realize your answer was looking for a solution using VLOOKUP, but I think a cleaner method would be to use a COUNTIFS formula.
As mentioned by #drewster, you'll first need to add a helper column to Sheet1. I placed mine in Sheet1!Column A so that it's out of the way of the user and less likely to be corrupted in any way, especially after hiding it, but you can place yours in any convenient column.
There is no formula in Sheet1!Column A, only hardcoded values (which you'll need to enter).
Helper column added to Sheet1
Then on Sheet2 you need to add a conditional formatting rule using the Use a formula to determine which cells to format rule. In the formula box under where it says, Edit the Rule Description, your formula will be:
=COUNTIFS(Sheet1!$A$2:$A$100,"Invalid",Sheet1!$C$2:$C$100,$C2)>0
The ranges I used in the formula - Sheet1!$A$2:$A$100 & Sheet1!$C$2:$C$100 - should cover your entire "table" of information on Sheet1, so adjust those as needed. $C2 is the first cell on the conditionally formatted sheet that you are attempting to match to Sheet1!$C$2:$C$100.
Also, make sure your rule Applies to your entire "table" of information on Sheet2 (my example uses range =$A$2:$D$101, so feel free to change that as well).
Conditional Formatting Rules Manager for Sheet2
Conditional formatting applied to Sheet2
After all of this, you should get your desired result.

Conditional Formating - multiple cells with different relations

So here is what I am looking for:
I want to highlight several cells, such as A1:A5 need to turn red based on a conditional format formula.
The conditional format for A1 would be:
=((A1/B1)<C1)
If true the cell turns red. Note C1.
The conditional format for A2 would be:
=((A2/B2)<C1%)
If true the cell turns red. Note it is still C1.
So here is the obvious question; how can I copy and paste this conditional formatting so that C1 does not change so that I can have only 1 rule vs 5?
I cannot cause a comment to solve the question. So, all credit goes to Scott Craner.
=((A2/B2)< C $1)
At the point in time i asked this, i did not know the function of $. Thank you!

Formatting in cell depending on row in Excel

Lets say I have a name in cell A1. I'd like to make that cell green if there is "o" or "x" in any of the cells spanning B1:Z1.
Also, could you do this thing on a larger scale if you have 20 names under column A from A1:A20; so you don't need to format each cell individually?
Here is an example of my naughty and nice list:
A B C D
Name Mon Tue Wed
Mark x x
Donna o x o
Amy x
I tried to do it with conditional formatting on A2
=OR($B$2:$H$2="x";$B$2:$H$2="o")
but in this instance it only works on the first two examples, since the B column has a value in it.
Is it possible to do that on a list of 40 people on a mass scale. to not have to do formatting for each row seperately?
I'm using Excel 2013 if that helps in any way.
Ahh, now that I understand the question, the conditional format option can be applied.
Select cells A2:A20
Go to Conditional Formatting on the Home tab
Click on New Rule... and you will see something like this
Click the "Use a formula" option and enter this in the "Format values where..."
=OR(COUNTIF(A2:H2,"x")>0,COUNTIF(A2:H2,"o")>0)
and then click the Format... button to apply a green fill to the cells.
I'm using COUNTIFs because comparing or testing a range for a specific value needs an array formula which I've never really considered for a conditional format. It may work but I prefer the KISS principle.
I would do what you have (the OR expression,
=OR(NOT(ISBLANK(Table2[#[B]:[D]]))) (as an array, shift-+ctrl+enter)
) and put it in it's own column(E). Then just look at that with a formula in the conditional formatting that looks like:
=E2
for me this formula: =OR(B2:X2="o",B2:X2="x") produces the desired result, and I don't experience the strage problem "when B is empty" as you describe.
Not sure about the difference between ; and , separators - it has something to do with regional settings (some info here)

Formatting Selected Columns Depending Cell Value Is Odd Or Even

I have a sheet with several columns. Column A consists of numbers. Depending if the cell value in column A is even (or odd) I want to highlight several cells in that row, but not the entire row.
So far using conditionally formatting I have been able to add a formatting rule for each column I want to have highlighted. So for example if I want columns A, B and E highlighted I use three rules:
Formula: =ISEVEN(A1) - Highlight Format - Sheet!$A$1:$A100
Formula: =ISEVEN(A1) - Highlight Format - Sheet!$B$1:$B100
Formula: =ISEVEN(A1) - Highlight Format - Sheet!$E$1:$E100
...and etc for all additional columns.
But this is very cumbersome, I don't know how to make a rule to cover it all in once or even if it is possible. I'm guessing VBA might be the solution, but I'm kinda a rookie there.
Any clues on how to attack this?
You should just fix your reference column in the formula for that (A becomes $A in this case). The ranges it applies for then can be all put in the same rule as well:
Formula: =ISEVEN($A1) - Highlight Format - Sheet!$A$1:$B100;Sheet!$E$1:$E100
So no VBA required!
:) You do not need to sweat so much at all. I am not sure what your Highlight Format for. You can add the even, odd into the conditional formatting window/wizard text boxes and then choose the formatting colour accordingly.
Try this out:
For even:
=MOD(A1,2)=0
For odd:
=MOD(A1,2)>0
Check the following article for better help on Excel conditional formatting
Another article for 10 cools way to use Excel conditional formatting

Resources