简体   繁体   English

Excel-如果在另一列中找到内容,则格式化单元格

[英]Excel - Format cell if content found in another column

I have two columns of numeric values in Excel. 我在Excel中有两列数值。 This is a task list, column A is the task number, column C shows the number of any tasks that must be done before this task. 这是一个任务列表,A列是任务编号,C列显示了在此任务之前必须完成的所有任务的数量。 Both columns are formatted as "General". 两列的格式均设置为“常规”。

I want to highlight cells in column A that are listed as parents in column C. In some cases, a task might have more than one parent so the cell might have more than one number in it: 我想突出显示列为C列的父级的A列单元格。在某些情况下,一个任务可能有多个父级,因此该单元格中可能有多个数字:

6, 17, 105 6、17、105

My data spans from rows 6 through 1004 and I've tried the following: 我的数据从第6行到1004行,并且尝试了以下操作:

=ISNUMBER(SEARCH($A6,$C6:$C1004))

That works fine in other situations when I'm dealing with text, but not when the data is numbers. 在其他情况下,当我处理文本时,这种方法很好用,但是当数据是数字时,这种方法就不行了。 At least that's my theory for why it's not working here. 至少那是我的理论,为什么它在这里不起作用。

I've tried searching here and a general web search, but all the answers seem to apply to text data not numbers. 我尝试在这里进行搜索和常规的网络搜索,但是所有答案似乎都适用于文本数据,而不是数字。 How can I accomplish this with numeric data? 如何使用数字数据完成此操作?

Edit: 编辑:

Here's a screenshot of some of the data: 这是一些数据的屏幕截图:

Screenshot 屏幕截图

First column is the task number, third is a listing of "parent" task for the given task. 第一列是任务编号,第三列是给定任务的“父”任务列表。 For example, looking at task 81 at the bottom, it can't be done until tasks 17, 64 and 84 are done. 例如,查看底部的任务81,只有完成任务17、64和84后才能完成。 What I want to do is format any task number that has children. 我要做的是格式化任何有子代的任务号。 So, in the example I just mentioned, task 84 (near the top) should be colored differently since it has a "child". 因此,在我刚才提到的示例中,任务84(靠近顶部)的颜色应不同,因为它具有“子级”。

Please clear any existing CF from ColumnA, select it and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true: : 请清除ColumnA中现有的所有CF,然后选择它,然后选择HOME>样式-条件格式,新规则..., 使用公式确定要格式化的单元格,在此公式为true的情况下格式化值 ::

=AND(A1<>"",MATCH("*"&A1&"*",C:C,0)) 

Format... , select choice of formatting, OK . 格式... ,选择格式选择, 确定

Assumes all of ColumnC is Text format. 假定所有ColumnC均为文本格式。

If that does not suit please (a) ensure your text and your data sample are compatible, (b) provide the sample in Text format (not only image) and (c) indicate exactly what you would like highlighted. 如果那不适合,请(a)确保您的文本和数据样本兼容,(b)以文本格式( 不仅是图像)提供样本,并且(c)准确指出您想要突出显示的内容。

暂无
暂无

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

相关问题 EXCEL:检查是否在另一列中找到单元格文本 - EXCEL: Check if cell text is found in another column Excel条件格式-根据另一个单元格值将文本插入列 - Excel conditional format-Text into column based on another cell value Excel:如果单击另一个单元格,则删除单元格内容 - Excel: Delete cell content if another cell is clicked EXCEL:如何在列中查找一个单元格值并在另一个单元格中复制找到的值 - EXCEL: How to find a cell value in column and copy the found value in another cell 在 Excel-VBA 中是否可以仅根据另一个单元格的内容在列(或行或单元格)中移动? - In Excel-VBA Is it possible to move in a column (or row, or cell) based solely on the content of another cell? Excel-如果特定列中的单元格包含在另一列中找到的值,则删除行 - Excel- Delete rows if a cell in a particular column contains values found in another column Excel - 根据内容格式化活动单元格 - Excel - Format active cell based on content 如果内容与另一列相匹配,则希望在excel中循环浏览一列并突出显示填充每个单元格 - Looking to loop through a column in excel and highlight fill each cell if the content matches that of another column 在Excel 2007条件格式中,如何根据锁定列的单元格内容来格式化整个行? - In Excel 2007 conditional formatting, how to format an entire row based on the content of a cell of a locked column? 在 Excel 检查两个单元格中的短语,如果在两个单元格中找到任何列出的单词,则需要在另一个单元格中添加该单词。 对整列重复此操作 - In Excel Check phrases in two cell and in the two cell if any listed word found,need to add the word in another cell. repeat this for entire column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM