简体   繁体   English

如果列B在Excel中包含正确的值,则突出显示列A中的单元格

[英]Highlighting cells in column A if column B contains the correct value in Excel

I am trying to get a cell in column A to be highlighted if the corresponding cell in column B contains a certain value. 如果B列中的相应单元格包含某个值,我试图让A列中的单元格突出显示。 It's easy enough conditional formatting column B on its own but I would like to carry the colour across to column A no matter what value is in the A column. 条件格式化B列本身很容易,但我想将颜色传递到A列,无论A列中有什么值。

Say "Joe" is working sat, sun, mon and not working tue, wed, thu, fri, his name is in column B across from the the days he is working labeled in column A. I would like to highlight the days as well as his name whenever he is "working". 说“乔”正在工作,太阳,星期一和不工作星期二,星期五,星期四,星期五,他的名字在B栏中标记为A栏的对面的B栏。我想强调这些日子每当他“工作”时都是他的名字。

I hope this makes sense. 我希望这是有道理的。 I look forward to hearing if anybody has created or used a formula in this way before. 如果有人以前以这种方式创造或使用过配方,我期待着听到。

You can set conditional formatting in A2 based on a formula, so set the formula to something like the following: 您可以根据公式在A2设置条件格式,因此将公式设置为如下所示:

=B2="Joe"

To copy over the conditional formatting to the other cells, I selected the range and used Ctrl+Y to redo the conditional formatting. 要将条件格式复制到其他单元格,我选择了范围并使用Ctrl+Y重做条件格式。 It changed the formula to match the current cell. 它更改了公式以匹配当前单元格。

Note: I did this in Excel XP, as I don't have Excel 2010 in front of me. 注意:我在Excel XP中这样做,因为我没有在我面前使用Excel 2010。

To format both columns (as requested), select ColumnA:B, clear existing CF rules from them 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:B,从中清除现有CF规则和HOME>样式 - 条件格式,新规则..., 使用公式确定要格式化的单元格格式化此公式所在的值是的

=$B1="Joe"

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

For me also Ctrl + Y does not here work for copying down, let alone the copy across aspect. 对我来说, Ctrl + Y也不适用于复制,更不用说复制方面了。

暂无
暂无

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

相关问题 Excel公式将A列和B列的值转移到C和D空单元格 - Excel Formula to shift value of Column A and B to C and D empty cells 如果该列中的任何单元格包含红色,则突出显示列标题 - Highlighting column headings if any of the cells in that column contains red colour Excel VBA-如果列B包含任何值,则使用值更新列A。 如果列B不包含任何值,则不要运行宏 - Excel VBA - Update column A with a value if column B contains any value. If column B contains no values then do not run the macro Excel VBA-如果B列中的单元格包含一个值,则A列等于“值”,但不要覆盖现有的A列数据 - Excel VBA - If a cell in column B contains a value then column A equals “value” BUT do not overwrite existing column A data Excel VBA如果B列包含一个值,然后将该值复制到A列,则不会覆盖现有的A列数据 - Excel VBA if Column B contains a value then copy that value to Column A do not overwrite existing Column A data EXCEL 如何检查A列是否包含特定值,B列是否包含2个特定值? - EXCEL How to check if Column A contains specific value and Column B contains 2 specific values? Excel-如何比较2列中的单元格,如果B列匹配,则使用B列中匹配单元格旁边的C列中的值? - Excel - How to Compare Cells from 2 Columns then if Column B Matches, Use the Value in Column C next to the Matching Cell in Column B? Excel:使用[column_A的唯一单元格,其中column_B值= SomeValue]填充下拉列表 - Excel: Populate drop-down with [unique cells of column_A, where column_B value = SomeValue] Excel条件格式,如果列A包含任何值高亮显示列B中的相邻单元格 - Excel Conditional Formatting If Column A Contains ANY Value Highlight Adjacent Cell In Column B 如果B列的单元格值包含A单元格值 - If column B cell value contains A cell value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM