Copyright © 2005 by Philip L. Bewig of Saint Louis, Missouri, USA. All rights reserved. This work is available under the Creative Commons Attribution-NonCommercial-NoDerivs License. For information regarding this license, visit http://creativecommons.org/licenses/by-nc-nd/2.0/ or write to CreativeCommons, 559 Nathan Abbott Way, Stanford, California 94305, USA. Excel is a registered trademark of Microsoft Corporation.
How do you know your spreadsheet is right?
Principles, Techniques and Practice of Spreadsheet Style
Philip L. Bewig — July 28, 2005
You know it’s true: Spreadsheets have errorslike dogs have fleas.
1
It is generally accepted
2
that nine out of every ten spreadsheets suffersome error, and consequences can be severe:
3
•
A cut-and-paste error cost TransAlta $24 millionwhen it underbid an electricity-supply contract.
4
•
A missing minus sign caused Fidelity’s MagellanFund to overstate projected earnings by $2.6 billion(yes,
billion
) and miss a promised dividend.
5
•
Falsely-linked spreadsheets permitted fraud totaling$700 million at the Allied Irish Bank.
6
•
Voting officials reported spreadsheet irregularities inNew Mexico
7
and South Africa.
8
•
A new drug introduction was delayed several monthsby an untested macro, costing the pharmaceuticalcompany profits and its patients misery.
9
You can’t eliminate errors from the spreadsheetsyou develop, but you can reduce their number.The principles and techniques described below,applied consistently, will improve the quality of your spreadsheets. The discussion assumes Ex-cel, but the principles and techniques apply eve-rywhere. The spreadsheet shown below will beused as a practical example:
Think before you write.
Resist the urge to jump right in to actual development. Start witha clear understanding of the requirements of your task. Sketch your design on a whiteboard,and look for flaws. Consider alternate softwaretools such as databases,
10
statistics packages,
11
financial modeling systems,
12,13
business intelli-gence systems,
14,15
mathematical programminglanguages,
16,17,18
and traditional computer pro-gramming languages. This is the most funda-mental level of your work, and the most creativemoment in the entire existence of your spread-sheet. An error here can be hard to fix, requir-ing massive rearrangements of the spreadsheetstructure or new inputs from new sources.
Know the players.
The
reader
sees the printedoutput, and uses it to make a decision; he relieson you to organize and present the data heneeds, as he needs it. The
user
inputs data, op-erates macros, and prints output, but doesn’tmodify anything; he relies on you to provideadequate instructions. You, the
developer
, de-sign and implement the structure and all theformulas in the spreadsheet. The
auditor
checksthe work of the developer; he relies on you toproduce a clean design and good documenta-tion. The
sponsor
assigns the task, provides re-sources, and has overall responsibility for thespreadsheet; he relies on you to meet his speci-fications. In many cases some of these rolesoverlap; keep them all in mind as you developyour spreadsheet.
Make your spreadsheet as simple as possible,but no simpler.
19
Most spreadsheets work wellenough with a few
SUM
s and
IF
s, and usingfunctions like
SUMPRODUCT
or features like arrayformulas, or writing your own macros and func-tions, can make a spreadsheet harder to read andunderstand than it should be. On the other hand,don’t “dumb down” your spreadsheet, feel freeto hide complex logic in user-defined functions,
Leave a Comment