Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Formatting

Status
Not open for further replies.

TOTCOM11

Programmer
Aug 5, 2003
199
US
Is there a way to use IF THEN statements to execute formatting? Such as IF(C1=C2, fill cell with yellow, do nothing) or IF(C1=C2, make text in cell bold, do nothing). Basically I want to be able to format a cell depending on what a value in another cell is. Is this possible without using VBA code?
 
By the way, I forgot to mention I'm trying to do this in MS Excel.

Thanks,
TOTCOM11
 
You answered your own question in your title. (Use Conditional Formatting)

Menu: Data / Conditional Formatting...

Select "Formula Is" in the combo box.
Put [tt] =C1=C2 [/tt] in the input field
Click Format..., select Patterns and pick a color
Click Ok
Click Ok

 
Is there a way to copy conditional formatting like you can with a normal formula?
 
I'm having a problem when I have two formats in my conditional format tool. I want a cell to be bold if it does not agree with another cell, and I want it to be yellow if it does agree with a different cell. I have it set up correctly, but if both conditional formats are true, I only get one to appear...
 


Then you need a 3rd condition that you need to evaluate FIRST.

Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
I want both conditions to display. What do I need a third condition for? What would I put in the third condition?
 
condition1 -> bold plus yellow fill
condition2 -> bold
condition3 -> yellow fill

Condition1 is that both condition2 and condituon3 are true.

(I think I am right that it stops at the first true condition, otherwise swap condition 1 and 3)



Thanks,

Gavin
 
Now THAT makes sense. Thanks Gavona! I really appreciate your help!
 
Alrighty, I tried that. Let's say I have 2 cells I'm comparing another to. For sake of conversation we have cells A, B, and C. Cell A is the cell I am coding. If cell A is equal to cell B, then I want the text to be yellow, but if cell A is equal to cell C, I want the text to be bold. If cell A is equal to BOTH cell B and cell C, then I want to have bold yellow text. Does that make sense? I think in the current solution that has been proposed, I cannot use unions to say that if A=B amd A=C make the text bold and yellow? Any help on this?
 

Condition 1 formula: [tt]=AND(A1=B1,A1=C1)[/tt]
Condition 2 formula: [tt]=A1=B1[/tt]
Condition 3 formula: [tt]=A1=C1[/tt]

Set formats as desired.

 
the first condition should read
Formula is
=and(A1=B1, A1=C1)

Second condition should read
Cell Value is
Equal To
=B1

Third condition should read
Cell Value is
Equal To
=C1

[tt]_____
[blue]-John[/blue]
[/tt][red]Quidquid latine dictum sit, altum viditur[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Dang. Late on the draw again.

[tt]_____
[blue]-John[/blue]
[/tt][red]Quidquid latine dictum sit, altum viditur[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Here's a link to a file that includes several examples of Conditional Formatting, as well as other Excel tips.

//
You can be assured the zip file is safe, as it comes from a reputable company - The Office Experts. The Excel file itself is also safe (no VBA code).

Regards, Dale Watson
 
Alright, I tried the code you guys recommended, and I STILL only get one of the formats when both arguments are satisfied. What am I doing wrong? I copied the code verbatim...
 
OK, I figured it out... I needed to set the formatting so it read the argument as a formula, not as a value. Now that I switched that, it works. Thanks for your help!
 
Nevermind, it doesn't work. I get the same outcome. Help please!
 
Alright, I'm done for sure now. I had the wrong cells showing up. Thanks again fro everyone's help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top