Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Iterating Circular References.

Iterating Circular References

by Allen Wyatt
(last updated July 4, 2015)

1

Circular references occur when a formula refers—either directly or indirectly—to the cell in which the formula is stored. For instance, if B3 contains the formula =B2+B3, then B3 contains a circular reference.

Normally, circular references represent a mistake in a formula. There are some situations in which circular references are desirable, however. Excel allows you to include circular references in a worksheet, but it can get a bit picky about them.

For the most part, Excel is very lenient about circular references if you have the Iteration control turned on. (Choose Options from the Tools menu and display the Calculation tab.) If you select the Iteration check box, and then enter a circular reference, then Excel doesn't protest. Instead, it uses the settings on the Calculation tab to control how many times the circular reference is repeated before it is considered done.

It appears that the setting of the Iteration check box is stored as part of a workbook, but it is not always paid attention to when the workbook is later loaded into Excel. In fact, the setting is ignored completely if any of the following occur before you open the workbook:

  • You open any other workbook besides the default workbook created when you first start Excel.
  • You change the Iteration check box while the default workbook is displayed.

What Excel does is to examine the Iteration check box setting for whatever workbook you first open. That setting becomes the "default" for the current session with Excel. For any other workbook loaded during the same session, the saved setting of the Iteration check box is ignored.

In addition, if you have a Personal.xls workbook defined on your system, then the setting of the Iteration check box within that file is always used as the default. Why? Because Personal.xls will always be the first workbook opened, and the first workbook opened always defines the default for the setting.

If you have a saved workbook that uses circular references, and the Iteration check box is cleared (either by default or explicitly), then when you open the workbook containing the circular references, Excel displays a warning. If you don't want to see the warning, then the obvious solution is to either make sure that you open the workbook before any other workbook (so that its Iteration setting is used) or explicitly set the Iteration check box before opening the workbook.

If you don't want to bother worrying about which order you open workbooks and you don't want to always go change the setting of the Iteration check box, you can create a macro that ensures the Iteration check box is selected for the workbook. If you assign the macro to the Open event for the workbook, then it will run every time the workbook is opened, ensuring that you won't see the warning you don't want to see. The macro appears as follows:

Private Sub Workbook_Open()
    Application.Iteration = True
End Sub

If you have a Personal.xls workbook defined for your system, you can add this macro to it instead of to individual workbooks. In that way you can ensure that the Iteration check box is always selected for every Excel session.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2816) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Iterating Circular References.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Moving from Sheet to Sheet

Need to move quickly through the worksheets in a workbook? Learn the keyboard shortcuts and you can make short work of this ...

Discover More

Changing the Default Drive

Do you have a macro that need to read and write files? If so, then there is a good chance you need to specify the default ...

Discover More

Copying Formats to a New Worksheet

Do you want to copy formats from one worksheet to another? You can do so easily by using the Format Painter. It even works on ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (menu)

Calculating Fractions of Years

When working with dates and the relationship between dates, Excel provides a variety of worksheet functions that may prove ...

Discover More

Numbers in Base 12

Different professions use numbers in entirely unique ways. You may need to come up with a number that represents the number ...

Discover More

Converting to Octal

If you need to do some work in the base-8 numbering system (octal), you'll love two worksheet functions provided by Excel for ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 + 0?

2015-07-04 07:29:58

Michael

Default setting for the Iteration is false.

I have experienced a big risk/flaw for this setting as the calculation in the opened Excell files stops when meeting the cell with circular reference. The remaining cells are then not recalculated.

Have anyone else similar experiences?
/Michael


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.