Solved

Excel UDF slow - can add-in speed things up?

Posted on 2010-08-26
4
620 Views
Last Modified: 2013-12-17
Hi,
I have a complex excel workbook with quit some sheets (over 20) with lots of data on it (lets say 30 ranges of 100x100 cells per sheet).
In that workbook there are also a huge amount of formulas that mostly do vlookups, indexes and matches and some ordanary +-*/ calculations. Those formulas are often very complex (4 to 5 lines in the formula bar) so we had to put them in UDF's for readability and to keep things manageable. Which works very nice.
There is only one downside to this workbook: Calculating all formulas can take up to 5 minutes. And because a lot of formulas are linked to one another, we cannot just calculate one sheet but need to do a full calculation.

My question: is there a way to speed up all those UDF's?
I have searced the internet and found quit some stuff to speed things up but it never gives me the complete answer.
One thing that comes back every time is that native Excel functions are much faster than UDF.

So do I have to look for xll, COM/Automation add-in's or are UDF's in VBA still faster?

I have tried xll and COM/Automation add-in's but didn't find a solution yet.
As I mentioned, the formulas do a lot of lookup work so I'm guessing it would be best if I could use the Excel built-in lookup functions as they are quit fast.
But  so far I haven't succeeded in making the Excel Built-in functions work within an xll or COM/Automation add-in.

Any workable help or good ideas would be very much appreciated.

ps: Could "Add-in Express 2010 for Microsoft Office and .net"  do the job? Can't try that one as there is no trial version available...
0
Comment
Question by:Emenizer
  • 2
4 Comments
 
LVL 80

Accepted Solution

by:
byundt earned 500 total points
ID: 33538009
You might consider looking at the code developed by William Hooper to speed up VLOOKUP functions. He replaces those functions with alternatives that eliminate the dependency on entire columns or rows. VLOOKUP updates every time anything changes in its reference table. Hooper's functions update only when the specific cell you care about is changed.

The unfortunate part is the fact that Hooper's web page has been defunct for several years. You can use the Internet Time Machine to access it, however. http://web.archive.org/web/20041207214923/http://www.whooper.co.uk/excelstuff.htm

You'll need the code in a .xll (not one of the file formats I can post on Experts Exchange) and a .xla  There is a link at the bottom of Hooper's web page that lets you download it. Please post if you have difficulty--I do have a copy.

Brad
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 33538066
Emenizer,Ceteris paribus, native Excel functions will be faster than VBA UDFs, and even complex formulas that rely only on native functions will tend to be faster than UDFs.That said, xll UDFs should run faster than VBA UDFs, but it's still unlikely that they will run as fast as native functions.Brad gave you some great stuff there.  About all that I can add to it:1) Try to avoid array formulas if you can, even if it means using "helper columns".  Having a few thousand array formulas is a great way to slow your workbook to a crawl2) Some Experts here say that under some circumstances, INDEX/MATCH can be faster than VLOOKUPPatrick
0
 
LVL 3

Author Comment

by:Emenizer
ID: 33562976
@byundt: an interessting article! But the link to the zip on there isn't working anymore. You wouldn't have that one anymore, would you?
0
 
LVL 80

Expert Comment

by:byundt
ID: 33563555
Emenizer,
Try downloading that file here: https://filedb.experts-exchange.com/incoming/ee-stuff/7981-whooper.zip

Brad
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now