Incorporating Cell color fill in an "if" logical function?

G

Guest

I want to identify a specific cell by highlighting it with a cell fill color
when an "if" statement returns a "ture" response. How do I do this?
 
G

Guest

You can use Format->conditional formating, select "Formula is", and insert
the condition that evaluates to true/false in the text box.

Hope this helps,
Miguel.
 
B

Bernard Liengme

Select the cell(s); use Format | Conditional Formatting
In the dialog box you need: Cell Value is Equal to TRUE
The click the Format button in the dialog and open the Pattern tab
Select the fill colour you want
best wishes
 
G

Guest

I guess that my question is unclear. I do not want to change the content of
the cell, just the highlighting of the cell (i.e. If x=A, "B" with cell
highlighted,"B" with cell not highlighted)
 
G

Guest

I guess my question was not clear. I want to change the highliting of the
sell, not the cell content. (e.g. IF X=A, "B" with cell highlighted, "B"
winhout cell highlighted.)
 
H

Harlan Grove

George_Sky wrote...
I guess my question was not clear. I want to change the highliting of the
sell, not the cell content. (e.g. IF X=A, "B" with cell highlighted, "B"
winhout cell highlighted.)

Your original question *and* the two responses so far were all clear.
What's unclear is your ability or willingness to understand the
responses.

Conditional formatting DOES NOT affect cell values/contents.

Conditional formatting CAN affect the FORMATTING of cells based on the
values either in the cell in question or other cells.

Looks like you want to use Formula Is rather than Cell Value Is
conditions. Select the cell containing "B", run the menu command Format
 
S

Spiky

To be honest, I found both the question and the response to be very confusing.

Well, you dredged up a 2 year old thread for an offhand comment.
That's a little confusing, also.

But I'll assume you want to know about this. Maybe you should go open
Conditional Formatting to see what they were talking about. It won't
make sense if you don't look at it. It's in the Format menu in Excel.
Miguel's original response was right on, although Bernard's was more
detailed.
 
S

Shawn

I have a similar question to this thread...

I have a cell that contains an if statement that returns either I, II, III
or IV depending on criteria. Can I also make the cell turn a different colour
for each of these results? e.g. (Red for I, Orange for II, etc.) I used to
know how to do this in the old excel, but now I am using vista and excel 2007.

Thanks.

Shawn
 
T

T. Valko

I am using vista and excel 2007.

Try this...

Assume the cell in question is A1
Select cell A1
Goto Home tab>Styles>Conditional Formatting>Manage Rules
Click New Rule>Use a formula to determine.....
Enter this formula in the box: =A1="I"
Click the Format button
Select the desired style(s)
OK>OK>Apply

Now, click New Rule and repeat the process for each of the conditions.

This was much easier in previous versions of Excel!
 
S

Shawn

Thanks for your help. Worked out perfect!!

T. Valko said:
Try this...

Assume the cell in question is A1
Select cell A1
Goto Home tab>Styles>Conditional Formatting>Manage Rules
Click New Rule>Use a formula to determine.....
Enter this formula in the box: =A1="I"
Click the Format button
Select the desired style(s)
OK>OK>Apply

Now, click New Rule and repeat the process for each of the conditions.

This was much easier in previous versions of Excel!
 
M

MT

How do I go about formatting if I have more than 3 different conditions?
For example, text =
"Exceeds": Green
"Meets": Blue
"Below": Yellow
"Unacceptable": Red

thanks in advance for your help
 
G

Gord Dibben

Which version of Excel?

If earlier than 2007 you would need some code or use Bob Phillips' CFPlus
add-in.

http://www.xldynamic.com/source/xld.CFPlus.Download.html

Some event code...................

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A20" '<=== change to suit
check_words = Array("Unacceptable", "Below", "Meets", "Exceeds")
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
For i = LBound(check_words) To UBound(check_words)
If InStr(1, .Value, check_words(i)) Then
Select Case i + 1
Case 1: .Interior.ColorIndex = 3 'red
Case 2: .Interior.ColorIndex = 6 'yellow
Case 3: .Interior.ColorIndex = 5 'blue
Case 4: .Interior.ColorIndex = 10 'green
End Select
GoTo ws_exit
End If
Next i
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP
 
M

MT

Thanks Gord,

the add-in is helpful.
If i sent this same spreadsheet or opened it at another computer without the
add-in.
will the conditions still work? or on a different excel version.

Also,
i tried the event code: it's didn't work.
currently in using in excel 2003.
 
G

Gord Dibben

The recipient(s) would require CFPlus add-in to be accessible.

What is "didn't work" with regards to the event code?

The code needs to be pasted into the sheet module.

Right-click on the sheet tab and "View Code".

Paste the code to that module.


Gord
 
P

Peace153

T. Valko said:
Try this...

Assume the cell in question is A1
Select cell A1
Goto Home tab>Styles>Conditional Formatting>Manage Rules
Click New Rule>Use a formula to determine.....
Enter this formula in the box: =A1="I"
Click the Format button
Select the desired style(s)
OK>OK>Apply

Now, click New Rule and repeat the process for each of the conditions.

This was much easier in previous versions of Excel!
 
P

Peace153

Thanks for this tip. It worked for me too.

T. Valko said:
Try this...

Assume the cell in question is A1
Select cell A1
Goto Home tab>Styles>Conditional Formatting>Manage Rules
Click New Rule>Use a formula to determine.....
Enter this formula in the box: =A1="I"
Click the Format button
Select the desired style(s)
OK>OK>Apply

Now, click New Rule and repeat the process for each of the conditions.

This was much easier in previous versions of Excel!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top