Codematic Excel developers logo
Codematic spreadsheet-excel development image

Rapid Application Development / Advanced Excel Development

Products for Excel
Commercial Products:
  - Classic Ribbon
  - Alt-FileSearch
  - Password Remover
Spreadsheet Quality Products
Free Products
Excel Development
Excel Development Index
Excel VBA
- VBA IDE (editor)
- VBA Training
- VBA Best Practice
- VBA Performance
- COM Performance
- VBA Security
Excel and Databases
Excel and Pivot Tables
Excel Add-ins
Worksheet Functions
Excel and xlls
Excel (in)security
Excel testing
Excel and .net
Excel External Links
Excel Developer Types
Professional Excel Development
Excel 2007
Excel 2010
Excel Development Archive
Spreadsheet Services
Spreadsheet Development
Spreadsheet Migration
Spreadsheet Maintenance
Spreadsheet Review
Spreadsheet Management
Excel User Confs
Consultant Profile
Book Reviews
Site Map

Spreadsheet Quality

Spreadsheet Design Concepts Series

Cohesion 3 (Bad examples)

The classic example of poor cohesion in a spreadsheet is a block of cells that might reasonably be expected to contain the same formula, but in fact don't. A very common example which regularly catches maintainers out are tables of VLOOKUPS where the table column is hard coded, and changes in each column.

vlookup hardcoded column poor cohesion

In the above formula the 2 becomes a 3 in column F, a 4 in column G etc. This means changes that get copied across will break the model. This particular case can be fixed by using external column indexes so all formulas are identical:

better cohesion with index match

In this table the VLOOKUP is replaced by a MATCH to find the Total Expenses Row, and then a series of INDEXes that use the grey row above to find their column index.

This is a simple example, but common. Another all too common example is where the first formula in a running total is different from all those below.

Audit tools have long picked up on this, and in Excel from 2002 onwards one of the possible error checks is inconsistent formula in the region. This can be used to spot poor block cohesion, well it could if it worked, which it doesn't sadly. Most decent third part auditing tools will spot this though.

Poor cohesion can also occur at the sheet level, where for example a project settings sheet is used as a dumping ground for lots of fairly unconnected pieces of data. Indeed poor cohesion can occur at any level within the spreadsheet hierarchy whenever elements that are not directly or closely related are bundled together for developer convenience rather than as a clear design decision.



Upcoming Events:

25 January 2012 - UK Excel Developer Conference - London

Products for sale:


Office 2007 FileSearch replacement logo

New information about the missing FileSearch feature in Office 2007 and details of our pragmatic solution (Current price GBP 30.00)


worksheet password remover logo

Instant Excel worksheet protection remover and password recovery (Current price GBP 15.00)

Classic Ribbon Tab

classic ribbon for office 2007 logo

Add Excel 97/2000/2002/2003 compatible menu structure to Excel 2007
(Current Price GBP 10.00)


Products coming soon:

Link Manager

(Find and control external links in Excel Workbooks)

Due by Q1 2111.

XLAnalyst Pro

(Excel VBA based spreadsheet auditing tool)

Due before the end of 2111.

This page was last reviewed on December 21, 2011

©Codematic Ltd 1999-2011