Spreadsheet Efficiency: VLookup and Conditional Formatting to Remove Errors

April 20, 2009
By admin

I’ve started working at a new hospital and it seems to be plagued by unwieldy spreadsheets that have a tendency to crawl through saves and then sometimes refuse to open. They are riddled with links and lookups to external spreadsheets and the whole thing feels fairly precarious.

I’ve been reading a bit about good spreadsheet design with a view to whittling down the complexity and discovered that lookup functions are particularly demanding on the system.

Now I’m quite a sinner when it comes to the use of the double lookup function to remove errors such as #N/A and #DIV/0!

Here’s an example of such a formula that returns a blank if the first lookup function results in an error:

=IF(ISERROR(VLOOKUP(L$7&$C13,’[WTE Apportionment Tables.xls]WTE APP TABLES SUB F’!$B:$K,9,0)),”",VLOOKUP(L$7&$C13,’[WTE Apportionment Tables.xls]WTE APP TABLES SUB F’!$B:$K,9,0))

It works fine, but it doubles up the number of lookups that Excel needs to run through and for a large spreadsheet this can really slow down the performance.

It seems that conditional formatting is a suitable alternative but one that I’ve always ignored because I didn’t know how to structure the condition to work for errors.

I do now though and here’s how:

excel

1. Select the range you wish to apply the format to.
2. Goto Format – Conditional Formatting
3. Select Formula Is in the drop down box
4. Type the formula =iserror(ref) where ref is the reference to the first cell selected in the range
5. Hit Format and select the font colour to be white
6. OK – finished the job

Conditional Format 2

My current spreadsheet hasn’t grown that large yet but nevertheless it had 7200 of the double vlookups in 18 columns, by removing the unnecessary error catching lookup I dropped the file size by 22%.

As the errors weren’t actually removed, I had to use an array formula to get the totals for the column but that was included in the space saving above.

The array formula for summing a range with error values:

{=SUM(IF(ISNUMBER(H12:H418),(H12:H418)))}

NB. The curly brackets are achieved by entering the formula using CONTROL, SHIFT, ENTER.

Related Posts with Thumbnails
http://whatapalaver.co.uk/wp-content/plugins/sociofluid/images/digg_32.png http://whatapalaver.co.uk/wp-content/plugins/sociofluid/images/reddit_32.png http://whatapalaver.co.uk/wp-content/plugins/sociofluid/images/stumbleupon_32.png http://whatapalaver.co.uk/wp-content/plugins/sociofluid/images/delicious_32.png http://whatapalaver.co.uk/wp-content/plugins/sociofluid/images/google_32.png http://whatapalaver.co.uk/wp-content/plugins/sociofluid/images/facebook_32.png http://whatapalaver.co.uk/wp-content/plugins/sociofluid/images/twitter_32.png

Tags: , , , , , ,

2 Responses to “ Spreadsheet Efficiency: VLookup and Conditional Formatting to Remove Errors ”

  1. Vlookup Errors - The Third Way on April 20, 2009 at 9:19 pm

    [...] Book List ← Spreadsheet Efficiency: VLookup and Conditional Formatting to Remove Errors [...]

  2. Vlookup Errors - The Third Way on July 29, 2009 at 1:27 pm

    [...] List ← Spreadsheet Efficiency: VLookup and Conditional Formatting to Remove Errors Macros to Consolidate Worksheets [...]

Leave a Reply

flickr rss

IMG_0774Diktamos GorgeIMG_3222IMG_3220IMG_3207IMG_3205

What I'm Doing...

Posting tweet...

Ads



Reading List