简体   繁体   English

的条件格式包含来自一系列值的某些文本

[英]Conditional formatting for contains certain text from a range of values

How do you do conditional formatting to find out if range 2 contains the text value from range 1? 您如何进行条件格式查找范围2是否包含范围1中的文本值? For example check for Apple in red apple should highlight it. 例如,检查红色苹果中的Apple应该突出显示它。 I need to compare A3:A6 with C3:C7. 我需要将A3:A6与C3:C7进行比较。 The end result should be C3, C4 and C5 highlighted. 最终结果应突出显示C3,C4和C5。

A   B            C
1 Range1       Range2
==========================
3 Apple        Red Apple
4 Orange       Green Apple
5 Pear         Orange
6 Watermelon   Banana
7              Kiwi

I tried this formula but it only check B3 against Range2 and skips B4 to B6. 我尝试了此公式,但它仅针对Range2检查B3,并跳过B4至B6。

=FIND($B$3:$B$6,C3)>0

It is possible and I had fun working on this problem but I really wish you had done some work as well - seeing your own effort would have been just as rewarding as solving the problem by myself. 有可能,而且我很乐于解决这个问题,但我真的希望您也做了一些工作-看到您自己的努力与自己解决问题一样有意义。

在此处输入图片说明

The formula to be used with conditional formatting is: =NOT(ISERROR(AGGREGATE(15, 6, ROW($A$1:$A$4)/SEARCH($A$1:$A$4,B1), 1)))=TRUE 条件格式要使用的公式是: =NOT(ISERROR(AGGREGATE(15, 6, ROW($A$1:$A$4)/SEARCH($A$1:$A$4,B1), 1)))=TRUE

It obviously works as a normal, non-array formula too: 显然,它也可以用作普通的非数组公式:

在此处输入图片说明

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

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