简体   繁体   English

根据 Excel 中的单元格值突出显示行

[英]Highlight row based on cell value in Excel

In Excel, I have a sheet with data in 3 columns.在 Excel 中,我有一个包含 3 列数据的工作表。 Now I want to select all the rows that contain certain text in one of the specific columns, but that column contains multiple values per cell.现在我想选择在特定列之一中包含特定文本的所有行,但该列每个单元格包含多个值。

在此处输入图片说明

So in the above I want to highlight all the rows that in column C contain the text 'bbb'.所以在上面我想突出显示 C 列中包含文本 'bbb' 的所有行 If I add a new conditional formatting rule with the formula =$C1="bbb" only the 4th row is selected.如果我使用公式 =$C1="bbb" 添加新的条件格式规则,则仅选择第 4 行。 How can I also have the 1st and 2nd rows selected please?我怎样才能同时选择第一行和第二行?

You can use COUNTIF .您可以使用COUNTIF

As your conditional formula作为你的条件公式

=COUNTIF($C2,"*bbb*")

Then as your Applies To range然后作为您的适用范围

=$2:$200 

or whatever you last row is, but the start row needs to be the same as the row referenced in your conditional formula.或者无论最后一行是什么,但起始行必须与条件公式中引用的行相同。

You can also make "*bbb*" a reference to a cell so you could change it after the fact.您还可以使"*bbb*"成为对单元格的引用,以便事后更改它。 =COUNTIF($C2,"*" & $A$1 & "*")

在此处输入图片说明

Note that the column is locked in for the conditional formula ( $ C2) and the Applies to Range is the whole rows.请注意,该列已针对条件公式 ( $ C2) 锁定,并且适用于范围是整行。

(Working when cell contents are more than just "bbb") (当单元格内容不仅仅是“bbb”时工作)

在此处输入图片说明

Try this conditional formatting rule:试试这个条件格式规则:

=IF(FIND("bbb",C1)>0,TRUE,FALSE)

If "bbb" is found anywhere within C1 , it will return a number greater than 0 and will return TRUE .如果在C1任何位置找到“bbb”,它将返回一个大于 0 的数字并返回TRUE

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

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