基于另一个单元格值的背景颜色和文本的条件格式

时间:2021-06-25 19:42:14

I want to be able to test the value in cell $A$3 and determine if it has the text "YES" entered. IF $A$3 is "YES" then the cell $D$3 background should be set to a color and the text for cell $D$3 should say "NA".

我希望能够测试单元格$ A $ 3中的值,并确定是否输入了文本“YES”。如果$ 3美元为“是”,则单元格$ D $ 3背景应设置为颜色,单元格$ D $ 3的文本应设为“NA”。

I've tried using the following for Microsoft Excel 2003, but does not work. Any guidance would be appreciated. Thank you, Von

我尝试使用以下Microsoft Excel 2003,但不起作用。任何指导将不胜感激。谢谢你,冯

=IF($A$3="YES", "NA","") Additionally, I have the background color set to light Grey when true.

= IF($ A $ 3 =“YES”,“NA”,“”)另外,我将背景颜色设置为浅灰色时为真。

The background changes color when cell $A$3 is "YES", but the text of "NA" is not visible.

当单元$ A $ 3为“YES”时,背景会改变颜色,但“NA”的文本不可见。

3 个解决方案

#1


The syntax as given works for me in Excel 2003 SP2.

给定的语法适用于Excel 2003 SP2。

The coloring is done using Format -> Conditional Formatting. When you've got your conditions set up, select the 'Format...' button for each and set the format values the way you want using the dialog. There is a limit of three alternate formats that can be applied to a given cell this way.

使用格式 - >条件格式完成着色。设置好条件后,为每个选项选择“格式化...”按钮,并使用对话框以您希望的方式设置格式值。可以通过这种方式将三种替代格式限制为可应用于给定单元格。

#2


I know it sounds silly, but did you set both the text color and background color to light gray?

我知道这听起来很傻,但你是否将文字颜色和背景颜色都设置为浅灰色?

If you used the function in that manner (the correct one), and the background color is changing as expected, then there has to be something else causing this problem.

如果您以这种方式使用该功能(正确的),并且背景颜色正在按预期更改,则必须有其他原因导致此问题。

#3


In your conditional format, make sure to specify the color of the text as well as the background.

在条件格式中,请确保指定文本的颜色以及背景。

#1


The syntax as given works for me in Excel 2003 SP2.

给定的语法适用于Excel 2003 SP2。

The coloring is done using Format -> Conditional Formatting. When you've got your conditions set up, select the 'Format...' button for each and set the format values the way you want using the dialog. There is a limit of three alternate formats that can be applied to a given cell this way.

使用格式 - >条件格式完成着色。设置好条件后,为每个选项选择“格式化...”按钮,并使用对话框以您希望的方式设置格式值。可以通过这种方式将三种替代格式限制为可应用于给定单元格。

#2


I know it sounds silly, but did you set both the text color and background color to light gray?

我知道这听起来很傻,但你是否将文字颜色和背景颜色都设置为浅灰色?

If you used the function in that manner (the correct one), and the background color is changing as expected, then there has to be something else causing this problem.

如果您以这种方式使用该功能(正确的),并且背景颜色正在按预期更改,则必须有其他原因导致此问题。

#3


In your conditional format, make sure to specify the color of the text as well as the background.

在条件格式中,请确保指定文本的颜色以及背景。