简体   繁体   English

避免循环引用

[英]Avoid Circular Reference

I am trying to program a counter in column E where if in cell F2=F1, increase the counter, otherwise reset the counter to 1, but I keep getting a circular reference error for that cell.我正在尝试在 E 列中编程一个计数器,如果在单元格 F2=F1 中,则增加计数器,否则将计数器重置为 1,但我不断收到该单元格的循环引用错误。 This formula is placed in cell E2.此公式放置在单元格 E2 中。 The first value should be in cell E2 should be 1 because the value in cell F2 does equal the value in cell F1.单元格 E2 中的第一个值应为 1,因为单元格 F2 中的值确实等于单元格 F1 中的值。 How do I make this work without getting circular reference errors?如何在不出现循环引用错误的情况下完成这项工作?

循环参考

If your job list is sorted this formula works:如果您的工作列表已排序,则此公式有效:

=COUNTIF($A$1:A1,A1)

The important part is to fix the first part of the range to be filtered and the second part to be relative to the current position.重要的部分是固定要过滤的范围的第一部分和第二部分相对于当前的 position。

By that only the previous and current rows are filtered.这样,只有前一行和当前行被过滤。 在此处输入图像描述

If the list isn't sorted, the formula still works - but in case 14625 occurs at the end of the list ist will count as 4.如果列表未排序,则公式仍然有效 - 但如果 14625 出现在列表末尾,则将计为 4。

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

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