• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 688
  • Last Modified:

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

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...
  • 2
1 Solution
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.

Patrick MatthewsCommented:
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
EmenizerAuthor Commented:
@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?
Try downloading that file here: https://filedb.experts-exchange.com/incoming/ee-stuff/7981-whooper.zip


Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now