Share via

Formula to gray out cell

Anonymous
2011-02-02T20:48:55+00:00

I would like to create a formula that has a cell change color based upon the results of a prior cell.

Example:   The answer in cell B1 is Yes; if cell B1 is yes then cell b2 fill color changes to gray, if cell b1 is no then cell be2 fill color remains doesn't change and remains white.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2011-02-02T20:52:00+00:00

    Hi,

    Select B2 then

    Home tab|Conditional format|New rule|Use formula to determine which cells to format

    Enter the formula

    =B1="Yes"

    Click Format|Fill tab|Pick your colour|Ok all the way out


    If this post answers your question, please mark it as the Answer.

    Mike H

    7 people found this answer helpful.
    0 comments No comments

Answer accepted by question author

  1. HansV 462.6K Reputation points MVP Volunteer Moderator
    2011-02-02T20:53:40+00:00

    You don't use a formula in B2 for that, but conditional formatting.

    • Select cell B2.
    • Click Conditional Formatting > New Rule... in the Home tab of the ribbon.
    • Click "Use a formula to determine which cells to format".
    • Enter the following formula in the box:

    =B1="yes"

    • Click Format...
    • Activate the Fill tab.
    • Click the gray color that you prefer.
    • Click OK twice.
    3 people found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. HansV 462.6K Reputation points MVP Volunteer Moderator
    2012-10-11T09:33:56+00:00

    No, a formula by itself cannot change the formatting of a cell.

    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Anonymous
    2012-10-11T03:20:51+00:00

    I already have a formula.  Is there a way to add in the formula to shade the cell without using conditional formatting?

    0 comments No comments