ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   font color (https://www.excelbanter.com/new-users-excel/251062-font-color.html)

sapro

font color
 
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?


Ms-Exl-Learner

font color
 
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 FormatConditional Formatting For Condition1Select '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 Condition2Select '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 FormatConditional Formatting For Condition1Select '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 Condition2Select '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!

--------------------
(Ms-Exl-Learner)
--------------------


"sapro" wrote:

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?



All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com