Worksheetfunction vs UDF

The previous post provided VBA code for a number of trigonometric functions, most of which are already available in Excel.  Why bother you may say, why not just use the WorksheetFunction object?  The numbers below provide the answer:

Time to calculate ATan2() 65,536 x 16 times

XL2007

XL2000

VBA ATn2() 

1.60

1.21

Worksheetfunction

14.20

3.06

With Excel 2007 using a UDF in preference to Worksheetfunction gives a speed improvement of almost 10 times.  With Excel 2000 the difference is not so dramatic, but still a worthwhile 2.5 times improvement.

5 Responses to “Worksheetfunction vs UDF”

  1. Being picky -

    But not for spellers: An Excel blog for engineers and scientists, and an ->egineering<- and science blog for Excel users.

  2. mrt - OK, fixed.

    And congratulations on getting the first comment in :)

  3. Hi Doug -

    I followed the link here from Daily Dose of Excel, and I’ll be back, for I’m definitely not one of those $$$ guys.

    I really like your concept.

    …mrt

  4. [...] Worksheetfunction vs UDF [...]

  5. [...] Worksheetfunction vs UDF - 2 Filed under: Excel, UDFs — Tags: Excel 2007 performance, UDF, Worksheetfunction — dougaj4 @ 1:24 pm Previous Post [...]

Leave a Reply