简体   繁体   English

Excel 条件格式 - 基于一行单元格内的值结束单元格颜色

[英]Excel Conditional Formatting - end cell colour based on value within a row of cells

Just looking for some help, i'm new to this whole world.只是在寻求帮助,我是这个世界的新手。

I'm trying to create a spreadsheet that has 6 columns each with a value of 1-3.我正在尝试创建一个电子表格,它有 6 列,每列的值为 1-3。 If the value is 3 then the end "Warning" cell should be the colour green, if the value were 2 or 1 then the end cell should show as amber.如果值为 3,则结束“警告”单元格应为绿色,如果值为 2 或 1,则结束单元格应显示为琥珀色。

I know some basic VBA but I keep finding help based on Conditional Formatting - which is normally great.我知道一些基本的 VBA,但我一直在寻找基于条件格式的帮助——这通常很好。 However, I cant seem to get it to do the above without putting a conditional format on for each variable on each cell.但是,如果不为每个单元格上的每个变量设置条件格式,我似乎无法让它执行上述操作。 If I only had one row it would be ok, but I have 65 -I think Id go crazy before finishing that.如果我只有一排就可以了,但是我有 65 排 - 我想我在完成之前会发疯。

If there was any way for me to be able to select the entire row using CF and change the end cell colour based on the variables in that row then that would be great.如果有什么方法可以让我使用 CF 选择整行并根据该行中的变量更改结束单元格颜色,那就太好了。

I hope this makes sense, any help someone could give would be fantastic.我希望这是有道理的,有人能提供的任何帮助都会很棒。

Thanks!谢谢!

  1. Select the "Warning" column with focus on the first cell.选择“警告”列,重点放在第一个单元格上。
  2. Open the "Conditional formatting" and choose "New Rule"打开“条件格式”并选择“新建规则”
  3. Select "Use a formula to determine which cells to format"选择“使用公式确定要设置格式的单元格”
  4. Use an =OR(ref1=3,ref2=3,...) formula to test the values of other columns (or some more complicated formula if you want*) and set the corresponding formatting使用=OR(ref1=3,ref2=3,...)公式来测试其他列的值(或者一些更复杂的公式,如果你想要*)并设置相应的格式
  5. Validate证实
  6. Repeat for other formatting重复其他格式

* =SUMPRODUCT(--(C1:F1=3))>0 for example will set the formatting if any cell in C1:F1 is 3 * =SUMPRODUCT(--(C1:F1=3))>0例如将设置格式,如果 C1:F1 中的任何单元格为 3

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

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