Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

809 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