ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Change cell color for valid if statement (https://www.excelbanter.com/excel-discussion-misc-queries/255779-change-cell-color-valid-if-statement.html)

Chris H

Change cell color for valid if statement
 
When using an "IF" formula and the value is true, how do i change the color
in the results cell. I.E. if A61,"black", how do i get the cell to turn
black and say black

ExcelBanter AI

Answer: Change cell color for valid if statement
 
  1. Select the cell that you want to apply the conditional formatting to.
  2. Go to the Home tab in the ribbon and click on Conditional Formatting in the Styles group.
  3. Select New Rule from the drop-down menu.
  4. In the New Formatting Rule dialog box, select Use a formula to determine which cells to format.
  5. In the Format values where this formula is true field, enter your
    Code:

    IF
    formula. For example, if you want the cell to turn black if A6 is greater than 1, enter the formula
    Code:

    =A61
    .
  6. Click on the Format button to choose the formatting you want to apply to the cell. In this case, you want to change the font color to black, so select the Font tab and choose black from the color palette.
  7. Click OK to close the Format Cells dialog box.
  8. Click OK again to close the New Formatting Rule dialog box.

Now, when the
Code:

IF
formula evaluates to true, the cell will turn black. If you want the cell to display the word "black" as well, you can modify your formula to include it. For example,
Code:

=IF(A61,"black","")
will display "black" in the cell when A6 is greater than 1, and leave the cell blank otherwise.

Ms-Exl-Learner

Change cell color for valid if statement
 
You can do it by using Conditional Formatting. Have a look in the below
links for more details about it.

http://contextures.com/xlCondFormat01.html
http://contextures.com/xlCondFormat02.html
http://contextures.com/xlCondFormat03.html

Remember to Click Yes, if this post helps!

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


"Chris H" wrote:

When using an "IF" formula and the value is true, how do i change the color
in the results cell. I.E. if A61,"black", how do i get the cell to turn
black and say black


Luke M

Change cell color for valid if statement
 
Welcome to the world of conditional formats!

The formula in the cell will be:
=IF(A61,"black","")

With the cell selected, goto Format - Conditional format.
"Cell value is", "equal to", black
Hit the format button, and choose appropriate font/pattern color.

Alternatively, if you don't need the word black to appear in the cell, your
conditional format would be:
"Formula is", =A61

For more help/guidance, check out the XL help file on conditional formatting.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Chris H" wrote:

When using an "IF" formula and the value is true, how do i change the color
in the results cell. I.E. if A61,"black", how do i get the cell to turn
black and say black



All times are GMT +1. The time now is 02:16 AM.

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