excel - How to fix Circular Reference Dilemma in Excel
问题描述
I got three number values for which all the three are interconnected. So on using formulas to interconnect all the three I am having this circular reference error. Although the formulas work out in giving interconnected answer, on using other formulas over these values, lets say doing autosum on one of those three columns, it returns wrong answer. The situation could only be sited better with an example.
In this sample situation, values in columns B, C and D are interconnected.
B=D/C, C=D/B, D=B*C,
These three values are interconnected such that when any two values are entered the third one is automatically calculated. Enter the PRICE and TOTAL, then the QTY is automatically calculated; enter TOTAL and QTY, then PRICE is automatically calculated; enter PRICE and QTY, TOTAL is automatically calculated. And doing this formula gives the CIRCULAR REFERENCE ERROR. Although by clicking OK to the error warning, the values still get calculated as per the requirement, but there is this disturbing error message always in the sheet, and also additional formulas to any of those values won't work. In this given sample, the value of D13 returns wrong answer.
It would be so much useful if I could get a help here. Thanks in advance.
解决方案
I'm pretty sure that circular references are the wrong approach for whatever you are trying to do, but try with an array formula like =SUM(IFERROR(B4:11;0))
. Because it's an array formula, it must be entered pressing CTRL+ENTER+SHIFT
This formula will ignore all the error values, and sum up the right ones.
I would strongly suggest a different aproach for whatever you are trying to do.
SUGGESTION: Duplicate columns. Make 3 columns that will have, at least, 2 inputs. Then in the duplicate of those columns, put formulas with your rules:
My formulas are only in the orange part (yellow zone is for typing 2 or 3 values only)
- E4:
=SI(B4="";G4/F4;B4)
- F4:
=SI(C4="";G4/E4;C4)
- G4:
=SI(D4="";E4*F4;D4)
All of them check if the input is blank or not. If blank, then make calculation. If not, then gets the value of the original input.
Notice in yellow zone that in each row I got 2 different inputs. Orange zone gets calculated properly, with no circular references, and I can sum up all of them.
This will work only if you always type 2 inputs in the yello part. If you type just 1, it will raise circular reference error.
推荐阅读
- javascript - 如何从表中删除不等于某个值的行?
- python - 展平浮点数和 numpy 数组的列表
- r - 如何知道地块的名称?
- c# - Windows 下载的 DLL 被阻止
- reactjs - JSX 元素类型 [外部模块] 没有任何构造或调用签名
- chilkat - 使用 ckosshtunnel 和 AuthenticatePk 进行身份验证失败或部分成功
- javascript - 如何使用 Javascript 使用 \r\n 转换字符串变量中定义的数组?
- directus - 在 Directus 7 中将状态字段显示为下拉列表?
- c# - 将具有标准值的另一个表中的列中的所有记录插入到表中
- c - 是否可以创建一个循环多次扫描一个数字和一个字符串?(我作业的一部分)