简体   繁体   English

Excel中基于另一列中的值的条件格式

[英]Conditional formatting in excel based on value in another column

I have situation like this in excel: 我在excel中有这样的情况:

Col1 Col2
3.4  1
5.6  0
4.6  0
8.7  1
10.1 0

I want to format Col1 based on values of Col2. 我想基于Col2的值格式化Col1。 I want to fill the background of Col1 with say green if corresponding value in Col2 is 1 如果Col2中的对应值为1,我想用绿色填充Col1的背景

I saw some examples of coloring where value>value in other cell. 我看到了一些着色示例,其中其他单元格中的值>值。 But none of this type. 但是没有这种类型。

Thanks 谢谢

Here's how to do exactly what you say: 完全按照您的意愿进行以下操作:

  1. Select first cell in column A. 选择列A中的第一个单元格。
  2. Select Conditional Formatting/New Rule. 选择条件格式/新规则。
  3. Select Classic Style conditional formatting. 选择“经典样式”条件格式。
  4. Choose Use a formula to determine which cells to format. 选择使用公式来确定要格式化的单元格。
  5. Make the formula: =$B1=1 制定公式:= $ B1 = 1
  6. Choose your formatting (as in green) 选择格式(如绿色)
  7. Choose the Format Painter 选择格式刷
  8. Select the column to apply the conditional formatting to all cells in that column. 选择该列以将条件格式应用于该列中的所有单元格。 应用条件格式 Note: some variants in terminology and location of options between versions of Word, but the basic functionality is the same. 注意:Word版本之间的术语和选项位置存在一些变体,但基本功能相同。

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

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