Excel - IF statement checking if a cell's text is red

Asked By Shazze on 07-Sep-07 09:40 AM
I want to say :-
IF the text in A1 is formatted Red then, "yes" else "no"

Is there any way I can do this?

Ta v much

MartinW replied on 07-Sep-07 10:03 AM
Hi Shazzer,

You may be able to adjust this to your needs.

RayportingMonke replied on 07-Sep-07 10:06 AM
I would think that depends on the criteria you are using to turn the text
red... If you are using conditional formatting, then the IF statement would
mirror that of the conditional formatting.

What is the criteria you are using for the red text?
Shazze replied on 07-Sep-07 10:34 AM
The red cells have just been manually set.
Jason replied on 07-Sep-07 10:53 AM
I think you would have to make a new function.  There's a built in
function that gives information about the target cell, CELL, but it
doesn't return the actual color of the text.  I'm no expert, so this
example if really basic, but should work.  Put the following text into
a module in the spreadsheet in which you want to use the function:

Function CheckRed(target As Range)

If target.Font.Color = 255 Then
CheckRed = "Yes"
CheckRed = "No"
End If

End Function

In the cell that you would have put your IF statement, use this:


Hope this helps.
Darren Bartru replied on 07-Sep-07 11:50 AM
Create a named range (Insert ~ Name ~ Define)

In the Define Name dialog box enter a name in the 'Names in workbook:' box
(e.g. RedCell).

In the 'Refers to:' box enter this formula:

alternatively use:

which will return Yes if the cell to the immediate left of the cell
containing the formula is red (change the 0 & -1 to refer to different