Solved

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

Posted on 2010-08-26
4
633 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 81

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 81

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

803 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