简体   繁体   English

自动填充条件格式的单元格引用

[英]Autofill conditional formatting cell references

Excel conditional formatting fill down is working but not recording the correct formula once filled down. Excel条件格式填充有效,但一旦填充,将无法记录正确的公式。

eg. 例如。 Cells in Column B (eg B6) have a value ( active , exit , suspend ). B列中的单元格(例如B6)具有一个值( activeexitsuspend )。 The adjacent Column C cell needs to be colored green if the adjacent value in column B shows the entry active . 如果相邻的列C单元格中的值显示为active ,则相邻的C列单元格需要涂成绿色。 This works fine when using in C6 Use a formula to determine which cells to format , and Format values where this formula is true shows =B6="active" and cell C6 comes up filled with the green color. 在C6中使用时,此方法效果很好。使用公式来确定要格式化的单元格在该公式为true的情况下格式化值将显示=B6="active"并且单元格C6会变为绿色。

Upon fill down from cell C6 the formatting is all displayed correctly for each additional instance of the word active in a column B cell. 从单元格C6填写后,对于B列单元格中active单词的每个其他实例,格式都正确显示。 However when the conditional formatting rule is viewed for a cell such as C7, C8 onwards instead of showing =B7"active" or =B8="active" etc they still all say =B6="active" . 但是,当从诸如C7,C8之前的单元格查看条件格式设置规则时,而不是显示=B7"active"=B8="active"等,它们仍然都说=B6="active"

Does anyone know why they do not refer to their relative adjacent cell (B7, B8, B9 etc) instead of the original B6? 有谁知道为什么他们不引用其相对的相邻单元格(B7,B8,B9等)而不是原始的B6? The formula originally was =$B$6="active" and has been edited to remove the absolute reference and replaced with =B6="active" to allow a relative fill down. 该公式最初为=$B$6="active"并已被编辑以删除绝对引用,并用=B6="active"替换以允许相对填充。

Does anyone know why they do not refer to their relative adjacent cell ( B7, B8, B9 etc ) instead of the original B6 ? 有谁知道为什么他们不参考原始的B6而不是相对的相邻单元格(B7,B8,B9等)?

Presumably someone in Microsoft does and that is not the answer you seek. 大概是Microsoft的人做的,这不是您要寻找的答案。

However you acknowledge the formatting is working so it hardly seems to matter. 但是,您承认格式化有效,因此似乎无关紧要。

I can suggest that it is efficient. 我可以建议它是有效的。 Conditional Formatting with a formula has three key parts: 使用公式进行条件格式设置包含三个关键部分:

  • Formula
  • Formatting 格式化
  • Range 范围

Formula May be complex and lengthy. 公式可能很复杂而且很冗长。

Formatting It is what it has to be. 格式化这是必须的。 Usually a very simple fill colour but sometimes bold, font, font colour etc. 通常是非常简单的填充颜色,但有时是粗体,字体,字体颜色等。

Range The 'neglected' one of the three but equally important though simple - just co-ordinates defining one or more rectangles (or a singe cell reference otherwise the top left and bottom right references). 范围范围是三个中的“被忽略”之一,但同样重要,尽管简单-只是定义一个或多个矩形的坐标(或单一单元格引用,否则是左上和右下引用)。 An efficient way to define an area that works whether one cell or one million, still just two corners at most. 定义可工作的区域的有效方法,无论一个小区还是一百万个小区,最多仍然只有两个角。

You have probably noticed that whatever you enter there that is valid, anchors ( $ signs) will be added where not already provided. 您可能已经注意到,在此处输入的任何有效内容都将在尚未提供的位置添加锚点( $符号)。 You may also have noticed that Applies to will accept a named range - but Excel then automatically converts this to the cell reference/s. 您可能还注意到“ 适用于”将接受命名范围-但是Excel随后会自动将此范围转换为单元格引用。

It might help to consider what you would do if you were in charge of having doors painted yellow at house numbers 1 to 10 on a housing estate (yellow highlighting probably the most common format chosen for Conditional Formatting and a cell being roughly the shape of the surface of one side of a door). 如果您负责在住宅区的1号至10号房屋门上涂成黄色的门(黄色突出显示可能是条件格式设置中最常用的格式,而单元格的形状大致为黄色),可能会有助于您考虑将要做什么。门一侧的表面)。 Say during the process you were required to extend that to house numbers 11 to 15 also. 说在此过程中,您还需要将其扩展到11号至15号房屋。 Would you then produce five additional copies of the painting specification (the formula), it might be several pages long, or would you merely change your instructions to the team doing the work from "do this for houses 1 to 10" to "do this for houses 1 to 15"? 然后,您是否会另外制作五幅绘画规范(公式)副本,可能长几页,或者只是将对工作团队的指示从“为1到10栋房子做这件事”更改为“做这件事”? 1至15英寸的房子?

As you copy down the Applies to range adjusts accordingly, the system works. 当您复制“ 适用范围”调整时,系统将正常工作。 But for each rule there is only one range and that is the case in reverse, for each range thee is only one rule, So no need to express that rule cell by cell, hence perhaps a million times over. 但是,对于每个规则,只有一个范围,反之亦然,对于每个范围,您仅是一个规则,因此无需逐个单元地表达该规则,因此可能需要上百万次。

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

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