简体   繁体   English

如何使用条件格式替换单元格中的文本

[英]How to Replace Text in a cell Using Conditional Formatting

Let's say that in my Column A, I have a dropdown menu for "YES" and "NO". 假设我在A列中有一个“是”和“否”的下拉菜单。

If A1 == "YES"
   B1 = "CONGRATS!"
If A2 == "NO"
   B2 = "SORRY!"

I have applied the code below in column B's conditional formatting but didn't worked. 我已经在B列的条件格式中应用了以下代码,但是没有用。 Any possible option? 有没有可能的选择?

=IF(A1<>"YES", "SORRY","")

尝试:

=IF(A1="YES","CONGRATS!",IF(A1="NO","SORRY!",""))

If I'm understanding correctly, you are trying to create a formula that will change column B's value when A is equal to Yes or No? 如果我理解正确,那么您正在尝试创建一个公式,当A等于“是”或“否”时,它将更改B列的值。

I don't think this is an issue relating to conditional formatting, rather a simple formula should do the trick. 我不认为这与条件格式有关,而是一个简单的公式可以解决问题。

=IF(A1="YES","CONGRATS!",IF(A1="NO","SORRY!"))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM