font color

  • Thread starter Thread starter sapro
  • Start date Start date
S

sapro

I want result of this formula=if(x=y,"ok","not ok") be "ok" in green font and
"not ok" in red font. how can I write this formula?
 
Your query is not clear. I can take it in two ways.

1) Whether do you want to compare X column Cell with Y Column cells
OR
2) If X1 cell is equal to the text character of “Y†then do you want to get
the result as Ok otherwise not ok like that.

Anyway providing you the both methods below:-

Assumption 1:-
If you want to Compare X1 cell with Y1 cell and derive the result as ok and
not ok then use try the below:-
Paste this formula Z1 cell.
=IF(X1=Y1,"OK","NOT OK")
Place the Cursor in Z1 cell and hit Cntrl+Spacebar now the Total Z Column
will be selected, keep in mind that the active cell should be Z1 (Active cell
will have a white background after selection also).
Now goto Format>>Conditional Formatting>> For Condition1>>Select 'Formula
Is'>> Paste the below formula
=$X1=$Y1
Click Format and set the Font colour as Green and background as per your
desire give Ok.
For Condition2>>Select 'Formula Is'>> Paste the below formula
=$X1<>$Y1
Click Format and set the Font colour as Red and background as per your
desire give Ok.

Assumption 2:-
If you want to get Ok and Not Ok if the X1 cell value is “Yâ€, then try the
below.
Paste this formula Z1 cell.
=IF(X1="Y","OK","NOT OK")
Place the Cursor in Y1 cell and hit Cntrl+Spacebar now the Total Y Column
will be selected, keep in mind that the active cell should be Y1 (Active cell
will have a white background after selection also).
Now goto Format>>Conditional Formatting>> For Condition1>>Select 'Formula
Is'>> Paste the below formula
=$X1="Y"
Click Format and set the Font colour as Green and background as per your
desire give Ok.
For Condition2>>Select 'Formula Is'>> Paste the below formula
=$X1<>"Y"
Click Format and set the Font colour as Red and background as per your
desire give Ok.

Remember to Click Yes, if this post helps!
 
Back
Top