Cách khắc phục lỗi circular references warning! 10/2021

     

This short tutorial explains the basics of Excel circular reference and why you should beware of using them. You will also learn how to lớn check, find and remove circular references in Excel worksheets, and if none of the above is an option, how to enable và use circular formulas.

Bạn đang xem: Cách khắc phục lỗi circular references warning! 10/2021

You watching: How to lớn fix a circular reference error


*

You"ve tried to enter some formula in your Excel sheet, but for some reason it"s not working. Instead, it tells you something about a circular reference. Is this how you ended up on this page? :)

Thousands of users are facing the same problem on a daily basis simply because of forcing an Excel formula lớn calculate its own cell. When you try to vì chưng this, Excel throws up the following error message:

"Careful, we found one or more circular references in your workbook which might cause your formula lớn calculate incorrectly."

To put it simply, what Excel is trying lớn say is this: "Hey, I may get stuck at the round-about. Are you sure you want me to lớn proceed anyway?"

As you can understand, circular references in Excel are troublesome, and the common sense says to avoid them whenever possible. However, there may be some rare cases when an Excel circular reference is the only possible solution for the task you are faced with.

What is a circular reference in Excel?

Here is a very straight và concise definition of a circular reference provided by Microsoft:

"When an Excel formula refers back to lớn its own cell, either directly or indirectly, it creates a circular reference."

For instance, if you select cell A1 và type =A1 in it, this would create an Excel circular reference. Entering any other formula or calculation referring to A1 would have the same affect, e.g. =A1*5 or =IF(A1=1, "OK").

As soon as you hit Enter to lớn complete such a formula, you"ll get the following warning message:

*

Why does Microsoft Excel give you a heads-up? Because Excel circular references can iterate indefinitely creating an endless loop, thus significantly slowing down the workbook calculations.

Once you got the above warning, you can click Help for more information, or close the message window by clicking either OK or the cross button. When you close the message window, Excel displays either a zero (0) or the last calculated value in the cell. Yep, in some cases, a formula with a circular reference can complete successfully before it tries khổng lồ calculate itself, and when that happens, Microsoft Excel returns the value from the last successful calculation.

Note.
In many cases, when you enter more than one formula with a circular reference, Excel doesn"t display the warning message repeatedly.

But why would anyone want lớn make such a stupid formula that does nothing but cause unnecessary problems? Right, no sane user would ever want to lớn intentionally input đầu vào a circular formula like the above one. However, you may create a circular reference in your Excel sheet accidentally, & here"s a very common scenario.

Supposing you want to showroom up values in column A with a usual SUM formula, and when doing this you inadvertently include the total cell itself (B6 in this example).

If circular references are not allowed in your Excel (and they are turned off by default), you will see an error message we"ve discussed a moment ago. If iterative calculations are turned on, then your circular formula will return 0 lượt thích in the following screenshot:

*

In some cases, one or more xanh arrows can also appear in your spreadsheet all of a sudden, so you might think your Excel has gone mad và is about to crash.

*

In fact, those arrows are nothing more than Trace Precedents or Trace Dependents, which indicate which cells affect or are affected by the active cell. We will discuss how you can show and hide these arrows a bit later.

By now, you might have an impression that Excel circular references are a worthless and dangerous thing, & may wonder why Excel has not banned them altogether. As already mentioned, there are some very rare cases when using a circular reference in Excel can be justified because it provides a shorter và more elegant solution, if not the only possible one. The following example demonstrates such a formula.

Using an Excel circular reference - formula example

In one of our previous tutorials, we discussed how lớn insert today"s date in Excel. Và an overwhelming majority of questions posted in comments were about how to lớn enter a timestamp in Excel without it changing every time the worksheet is reopened or recalculated. I was very hesitant to lớn reply khổng lồ those comments because the only solution I know involves circular references, & they should be treated with care. Anyway, here is a very common scenario...

Supposing you have a danh sách of items in column A, and you enter the delivery status in column B. As soon as you type "Yes" in column B, you want the current date và time khổng lồ be automatically inserted in the same row in column C as a static unchangeable timestamp.

Using a trivial NOW() formula is not an option because this Excel function is volatile, meaning that it updates its value every time the worksheets is re-opened or recalculated. A possible solution is using nested IF functions with a circular reference in the second IF:

=IF(B2="yes", IF(C2="" ,NOW(), C2), "")

Where B2 is the delivery status, và C2 is the cell where you want a timestamp lớn appear.

*

In the above formula, the first IF function checks cell B2 for "Yes" (or any other text you supply to the formula), and if the specified text is there, it runs the second IF, otherwise returns an empty string. & the second IF function is a circular formula that fetches the current day và time if C2 doesn"t already have a value in it, thus saving all existing time stamps.

Note.
For this Excel circular formula lớn work, you should allow iterative calculations in your worksheet, & this is exactly what we are going khổng lồ discuss next.

Xem thêm:

How to enable / disable circular references in Excel

As noted earlier, iterative calculations are usually turned off in Excel be default (in this context, iteration is the repeated recalculation until a specific numeric condition is met). For circular formulas khổng lồ work, you must enable iterative calculations in your Excel workbook.See more: Không nội dung Được folder Trong Win 7 Để chia sẻ Dữ Liệu trong Mạng Lan

In Excel 2019, Excel 2016, Excel 2013, and Excel 2010, click File > Options, go khổng lồ Formulas, và select the Enable iterative calculation kiểm tra box under the Calculation options section.

In Excel 2007, click Office button > Excel options > Formulas > Iteration area.

In Excel 2003 & earlier, the Iterative Calculation option resides under Menu > Tools > Options > Calculation tab.

When you turn on iterative calculations, you must specify the following two options:

Maximum Iterations box - specifies how many times the formula should recalculate. The higher the number of iterations, the more time the calculation takes.Maximum Change box - specifies the maximum change between calculation results. The smaller the number, the more accurate result you get and the more time Excel takes khổng lồ calculate the worksheet.

The default settings are 100 for Maximum Iterations, and 0.001 for Maximum Change. What it means is that Microsoft Excel will stop calculating your circular formula after 100 iterations or after a less than 0.001 change between iterations, whichever comes first.

Why you should avoid using circular references in Excel

As you already know, using circular references in Excel is a slippery và not recommended approach. Apart from performance issues và a warning message displayed on every opening of a workbook (unless iterative calculations are on), circular references can lead to lớn a number of other issues, which are not immediately apparent.

For example, if you select a cell with a circular reference, và then accidentally switch to lớn the formula editing mode (either by pressing F2 or double-clicking the cell), and then you press Enter without making any changes khổng lồ the formula, it will return zero.

So, here"s a word of advice from many respected Excel gurus - try to lớn avoid circular references in your sheets whenever possible.

How to lớn find circular references in Excel

To check your Excel workbook for circular references, perform the following steps:

Go khổng lồ the Formulas tab, click the arrow next to Error Checking, and point lớn Circular References The last entered circular reference is displayed there.
Click on the cell listed under Circular References, và Excel will bring you exactly lớn that cell.

As soon as you vì chưng this, the status bar will notify you that circular references are found in your workbook & display an address of one of those cells:

If circular references are found in other sheets, the status bar displays only "Circular References" with no cell address.

Note.
This feature is disabled when the Iterative Calculation option is turned on, so you need to turn it off before you start checking the workbook for circular references.

How lớn remove circular references in Excel

Regrettably, there is no mechanism in Excel that would let you eliminate all circular formulas in a workbook on a button click. To lớn get rid of them, you will have lớn inspect each circular reference individually by performing the above steps, and then either remove a given circular formula altogether or replace it with one or more simple formulas.

How khổng lồ trace relationships between formulas and cells

In cases when an Excel circular reference is not obvious, the Trace Precedents and Trace Dependents features can give you a clue by drawing one or more lines that show which cells affect or are affected by the selected cell.

To display the trace arrows, go to lớn the Formulas tab > Formula Auditing group, & click one of the options:

Trace Precedents - traces cells that provide data khổng lồ a formula, i.e. Draws lines indicating which cells affect the selected cell.

Trace Dependents - traces cells that are dependent on the active cell, i.e. Draws lines indicating which cells are affected by the selected cell. In other words, it shows which cells contain formulas that reference the selected cell.

Alternatively, you can use the following shortcuts:

Trace Precedents: Alt+T U TTrace Dependents: Alt+T U D

To hide the arrows, click the Remove Arrows button that resides right underneath Trace Dependents.See more: cách Tạo Zalo Không đề xuất Số Điện Thoại bên trên Iphone, android Và máy Tính

In the above example, the Trace Precedents arrow shows which cells directly supply data to B6. As you can see, cell B6 is also included, which makes it a circular reference và cause the formula to return zero. Of course, this one is easy to fix, just replace B6 with B5 in SUM"s argument: =SUM(B2:B5)

Other circular references might not be that obvious và require more thought and calculations. The following article makes a good job explaining how you can solve circular references by using basic algebra.

This is how you giảm giá khuyến mãi with Excel circular references. Hopefully, this short tutorial has shed some light on this "blind spot", & now you can bởi vì further research to lớn learn more. I thank you for reading & look forward lớn seeing you on our blog next week!