Excel条件格式公式并排比较两个表
我有两个并排的表格(尺寸相等),我想突出显示相等的单元格。 (这两个表是并排的,因为 Excel 2007 不允许跨工作表进行条件格式设置)。
假设表 B 与表 A 偏移 16 行,我认为我的公式将是:(
=INDIRECT(CELL("address"))=OFFSET(INDIRECT(CELL("address")),0,16)
对于“格式化此公式为真的值”框)。
但我错了。输入的正确公式是什么?
I have two tables side by side (equal dimensions), and I want to highlight the cells that are equal. (The two tables are side-by-side because Excel 2007 doesn't allow Conditional Formatting across sheets).
Supposing that table B is offset from table A by 16 rows, I thought my formula would be:
=INDIRECT(CELL("address"))=OFFSET(INDIRECT(CELL("address")),0,16)
(For the "Format values where this formula is true" box).
But I'm in error. What would be the correct formula to enter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要使用 Cell 函数,您必须指定第二个可选的“Reference”参数。来自 Excel 2010 帮助:
“如果省略 [参考参数],则返回最后更改的单元格的 info_type 参数中指定的信息。如果参考参数是单元格区域,则 CELL 函数仅返回以下信息:该范围的左上角单元格。”
更好的是,不要使用计算密集型间接函数。假设您已突出显示左侧表格数据行并且活动单元格为 A2,请在条件格式中输入此内容,确保它使用相对引用(无“$”符号):
编辑 - 甚至更好,如评论所述@chris neilsen,消除同样有效的计算密集型 Offset 函数:
To use the Cell function, you have to specify the 2nd, optional, "Reference" argument. From Excel 2010 help:
"If [the reference argument is] omitted, the information specified in the info_type argument is returned for the last cell that was changed. If the reference argument is a range of cells, the CELL function returns the information for only the upper left cell of the range."
Better yet, don't use the calculation-intensive Indirect function. Assuming you've highlighted the left-hand table data rows and the active cell is A2, enter this in your Conditional Formatting, making sure that it uses relative referencing (no "$" symbols):
EDIT - Even better yet, as commented by @chris neilsen, eliminate the also calculation-intensive Offset function for the equally effective: