简体   繁体   English

突出显示包含扩展列表中单词的单元格

[英]Highlight Cells That Contain Words From an Expanding List

I need to use a formula and conditional formatting to highlight cells that contain keywords from a list. 我需要使用公式和条件格式来突出显示包含列表中关键字的单元格。 The problem is that the list is not always the same size. 问题在于列表的大小并不总是相同。

Screenshot: 屏幕截图: screenshot_示例数据

What would be the most efficient formula to do that? 这样做最有效的公式是什么?

Here is an option: 这是一个选项:

在此处输入图片说明

  • Select A2:A20 选择A2:A20
  • New formatting rule: =SUMPRODUCT(--(ISNUMBER(SEARCH(INDIRECT("$B$2:$B$"&COUNTA(B:B)),$A2))))>0 新的格式设置规则: =SUMPRODUCT(--(ISNUMBER(SEARCH(INDIRECT("$B$2:$B$"&COUNTA(B:B)),$A2))))>0
  • Apply formatting and confirm 应用格式并确认

While INDIRECT is volatile, it's okay to use in conditional formatting because conditional formatting is volatile on it's own. 尽管INDIRECT是易失性的,但可以在条件格式中使用它,因为条件格式本身就是易失性的。

Note, this will also highlight the cells that contain a words that have a keyword as substring, eg Motorboat will highlight with keyword Motor 注意,这还将突出显示包含带有关键字作为子字符串的单词的单元格,例如Motorboat将使用关键字Motor突出显示

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

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