11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 16: Intentional Circular References 421<br />

If you have all workbooks closed and you create a new workbook, the new workbook<br />

uses the same Calculation mode as the last closed workbook. The exception is if you create<br />

the workbook from a template, the workbook uses the calculation mode specified in<br />

the template.<br />

If the mode of calculation in a workbook changes and you save the file, the current mode<br />

of calculation saves with the workbook.<br />

Bottom line? When you open a workbook that uses iteration, there is no guarantee that the setting<br />

saved with your workbook will be the setting that is in effect when you open the workbook.<br />

When the Enable Iterative Calculation setting is in effect, Excel will never display the<br />

Circular References warning dialog box and will not display the Circular References<br />

message in the status bar. Therefore, you may create an unintentional circular reference<br />

and not even know about it.<br />

Circular Reference Examples<br />

Following are a few more examples of using intentional circular references. They demonstrate<br />

creating circular references for entering unique random numbers, solving a recursive equation,<br />

solving simultaneous equations, and animating a chart.<br />

For these examples to work properly, the Enable Iterative Calculation setting must be<br />

in effect. Choose Excel Options, navigate to the <strong>Formula</strong>s section, and mark the Enable<br />

Iterative Calculation check box.<br />

Generating unique random integers<br />

This example demonstrates how to take advantage of a circular reference to generate unique<br />

(nonduplicated) random integers in a range. The worksheet in Figure 16-5 generates 15 random<br />

integers between the values specified in cells E1 and E2.<br />

Column B contains formulas that count the number of times a particular number appears in the<br />

range A1:A15 (named RandomNumbers). For example, the formula in cell B1 follows. This formula<br />

displays the number of times the value in cell A1 appears in the RandomNumbers range:<br />

=COUNTIF(RandomNumbers,A1)<br />

Cell B17, named Dupes, displays the number of duplicated values using this formula:<br />

=SUM(B1:B15)-COUNTA(B1:B15)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!