简体   繁体   English

根据复杂条件在Excel中突出显示单元格

[英]Highlighting cells in excel based on complex conditions

I am trying to do nested conditioned formatting. 我正在尝试嵌套条件格式。

Here is an example to explain: I have three tables, each of them is highlighted (green, or red) based on some condition. 这是一个示例说明:我有三个表,其中每个表都会根据某些情况突出显示(绿色或红色)。 In each table, the red highlighting is specific to the rows "LASSO", while the green highlighting is for the row "Stepwise". 在每个表中,红色突出显示特定于“ LASSO”行,而绿色突出显示特定于“ Stepwise”行。

  • Now, I would like to highlight in blue the column names (VAL, EQ, EFF, SIZE, ..) if the cells in corresponding columns are highlighted in each table in both green and red . 现在,我想用蓝色突出显示列名(VAL,EQ,EFF,SIZE等),如果每个表中相应列的单元格都以绿色和红色突出显示。

Example: MOM is highlighted in the 3 tables, and is highlighted in every table in both green and red (ie for both LASSO and Stepwise). 示例:MOM在3个表中突出显示,并且在每个表中均以绿色和红色突出显示(即,对于LASSO和Stepwise)。 In this case, I want to highlight the the cells F2,F9 and F16 in blue. 在这种情况下,我要用蓝色突出显示单元格F2,F9 and F16

  • Then, I would like to highlight in purple the column names (VAL, EQ, EFF, SIZE, ..) if the cells in corresponding columns are highlighted in each table in green OR red . 然后,如果每个表中相应的单元格以绿色或红色突出显示,那么我想用紫色突出显示列名(VAL,EQ,EFF,SIZE,..)。

Example: UMP is highlighted in all tables, but not in green and red in every table (as you see, in table 1, it is only highlighted in red, not green). 示例:UMP在所有表中都突出显示,但在每个表中都不以绿色和红色突出显示(如您在表1中看到的那样,它仅以红色突出显示,而不是绿色突出显示)。 In this case, I want to highlight the cells K2,K9 and K16 in blue. 在这种情况下,我想用蓝色突出显示单元格K2,K9 and K16

在此处输入图片说明

This is what I am looking for: 这是我在寻找的东西:

在此处输入图片说明

I apologize if the explanation is a bit confusing. 如果解释有些混乱,我深表歉意。 I am ready to give further details/examples if needed. 如果需要,我准备提供更多详细信息/示例。

Thank you, 谢谢,

Something along the following lines should suit: 符合以下情况的内容应适用:

SO18491189例子

applied to Row1 and then copied to rows 9 and 16 with Format Painter. 应用于行1,然后使用Format Painter复制到行9和16。

The actual components within the =AND will depend upon the trigger points for the existing green and red formatting. = AND中的实际组成将取决于现有绿色和红色格式的触发点。

Edit: Image for " applied to Row1 ": 编辑:“ 适用于第1行 ”的图片:

“ *应用于行1 *”的图像

It is however never a good idea to apply conditional formatting to more cells than really necessary (say ~ currently required + a reasonable margin for any future growth) because such formats are highly volatile. 但是,将条件格式应用于超出实际需要的单元格绝不是一个好主意(例如,当前需要+任何将来增长的合理余量),因为此类格式易变。

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

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