Ads 468x60px

Tuesday, July 3, 2012

Excel’s Auditing Functions [Spreadsheet Risk Management - Part 3 of 4]

Excel’s Auditing Functions [Spreadsheet Risk Management - Part 3 of 4]:
This series of articles will give you an overview of how to manage spreadsheet risk. These articles are written by Myles Arnott from Excel Audit
Introduction to Spreadsheet Risk Management
In the first two articles in this series we highlighted the risks that poorly managed spreadsheet solutions can introduce to a business and outlined the steps companies can take to manage this risk. This article works through the application of some of Excel’s built in auditing functions:
  • Error checking (Background and stepping through each error)
  • Trace Error
  • Circular Reference
  • Go To Special
Let’s have a look at an example spreadsheet that is riddled with issues.
Download Example file first.
The spreadsheet contains four tabs: a simple front page; an Example tab with the report that we wish to audit; a Resolved tab with the corrected report; and a Notes tab which details all of the issues contained within the spreadsheet (if you print the Resolved tab, all of the comments will also be printed for your reference).
If you are up for a challenge you could download the file and work through the report in the Example tab to see how many of the errors you can find yourself.

First off let’s identify the obvious issues

Circular reference

On opening the file you are presented with this warning message:
Circular Reference Warning - Excel's Auditing Functions
Click OK to continue opening the file. Here is how the report looks:
Excel Report Snapshot Risk Management - Excel's Auditing Functions
Excel helpfully gives you the location of the first circular reference (Q30) in the bottom left corner of the screen:
Circular Reference Status - Excel's Auditing Functions
An alternative approach to locating circular references is to select Error Checking > Circular References on the Formulas tab of the Ribbon:
Highlight Circular Refs - Excel's Auditing Functions
By clicking into the formula on cell Q30 you will see that the formula is =AVERAGE(M30:N30,P30:Q30). This average formula is including the cell Q30, hence the circular reference.
[Related: Understanding & Using Excel Circular References]

#REF error

The next obvious issue is that cells I13, J13, J33, S13, S18 & S33 contain the #REF error. The #REF error is a warning that the formula contains an invalid cell reference (this usually happens when the user deletes a cell/row/column/worksheet that is being referenced by a formula).
To trace the cell originating this error select any cell containing the error (I chose S33 as this would appear to be the main report total), and select Error Checking > Trace Error on the Formulas tab of the Ribbon:
Trace Formula Errors - Excel's Auditing Functions
This highlights that cell I13 is the source of the error:
Formula Error Arrows - Excel's Auditing Functions
Cell I13 contains the formula =3109+#REF!. To remove the error simply remove the +#REF! within the formula.
It is also however important to try to understand what cell was referenced by the formula originally. The best way to do this would be to talk to the user/previous user (if they are still there) and look back through archived versions of the report (if they exist).
Now that the obvious issues have been identified we are now going to employ some of Excel’s other auditing tools to see if there are any hidden errors.
[Related: Understanding & fixing Excel Formula Errors]

Excel’s error checking function

I’m sure that you will have noticed the small green triangles in the top left hand corner of some of the cells. This is Excel’s background error checking function warning you that these cells break one of the predetermined rules.
Excel Error Checking Example - Excel's Auditing Functions
Firstly let’s have a look at the errors that are being checked for. To open the Error Checking options select File > Options> Formulas (2010) or Office button> Excel options>Formulas (2007).
Below is the default set up:
Formula Editing Options Excel - Excel's Auditing Functions
When reviewing a spreadsheet for errors it is always worth a quick check to ensure that the above is set up as you would like it to be. I always also tick the “Formulas referring to empty cells” rule.
Click OK to return to the spreadsheet.

The most systematic way to walk through all of the issues identified by the error checking function is to run Error Checking on the Formulas tab of the Ribbon:
Error Checking From Ribbon - Excel's Auditing Functions
This launches the Error checking dialogue box and allows you to review each error in turn:
Error Checking Example - Excel's Auditing Functions
I will leave you to run through the errors one by one to see what Excel picks up.
Please note that this is not a fool proof check as it is simply checking against the predefined rules. This function will not highlight cells that comply with the rules but contain other errors. It can also highlight cells as an error when they are not (eg P13, in this case click on “Ignore Error”). A very useful starting point nonetheless.

Reviewing the report structure

A crucial step to ensuring that a spreadsheet is error free is to understand its structure, and then to ensure that this structure is correct and consistent.
The simplest way to do this is to identify the different types of cells and their relative positions within the worksheet. For this simple example we are looking to identify:
  • Input cells (Numbers)
  • Input cells (Text)
  • Formula cells
  • Formula cells returning an error
To achieve this quickly and simply I have built a basic macro which is within the spreadsheet and can be run from the “RUN” button in the Example tab.
This colors each cell type as follows:
Cell Style Types - Excel's Auditing Functions
This very quickly identifies some structural issues in the spreadsheet:
Using Cell Styles To Highlight Issues - Excel's Auditing Functions

So how does this work?

The macro above uses Excel’s Go To Special function which helps you to quickly select cells of different types.
To launch Go To Special, click on Find and Select> Go To Special on the Home tab of the Ribbon:
Goto Special Formula Debugging - Excel's Auditing Functions
(Alternatively press F5 or Ctrl + G to launch the Go To dialogue box and then click on Special…)
Goto Special Highlighting Numbers - Excel's Auditing Functions
For example, selecting Constants and leaving just Numbers ticked will highlight all numbers on the current worksheet:
Goto Special Highlighted Cells With Number Formulas - Excel's Auditing Functions
It is worth playing with the options on Go To Special as there are some great functions that I sadly don’t have time to cover here (the precedents, Dependents and Row/Column differences functions are particularly useful).
[Related: More uses of Go To Special in Excel]

And Finally…

As valuable as these initial tests are there are still some issues in the spreadsheet that only a detailed investigation will highlight.
So I’ll leave you to grab a coffee and see if you can find them (they are covered in the Notes and in the Resolved tab).
In the final article of the series we will have a quick look at an example of spreadsheet auditing software.
Also, we are planning to write an article explaining other useful features of Go To Special dialog.

What about you?

Do you use Spreadsheet auditing functions? What is your experience with them? What are your favorite features? Please share using comments.

Thank you Myles

Many thanks to Myles for writing this series. Your experience in this area is invaluable. If you enjoy this series, drop a note of thanks to Myles thru comments. You can also reach him at Excel Audit or his linkedin profile.

0 comments:

Post a Comment