Measuring Efficiency of Formulas and Macros

by Allen Wyatt
(last updated November 20, 2017)

3

Jerry notes that there are usually several ways to get the same results in Excel, such as various combinations of functions or VBA code. He knows there are some general guidelines for improving the efficiency of Excel workbooks, but notes that database designers have tools to measure and improve the efficiency of the queries that are run against their databases. Jerry wonders if there is any kind of similar tool an Excel user can use to measure the performance of a particular formula or macro to make the workbook calculate more efficiently.

There are many ways to go about improving the efficiency and calculation speed of your worksheets and your macros. The traditional method (at least when it comes to macros) is to insert some code that notes the start time of what you want to measure and then, after that code block is done, note the end time. By comparing the two you can find the elapsed time for that block and if it is unacceptable, focus your efforts on improving the algorithms in that block.

When it comes to actual formulas in a worksheet, you can't really measure elapsed time in the same way you can in a macro. All you could do (if you chose to do so) is to measure how long, overall, a recalculation took. Unfortunately, that doesn't help you narrow down what formulas you might need to change or how you might reorganize your worksheet.

If you want some tools that are more automated, you might consider purchasing Professional Excel Development, a book by Rob Bovey, Dennis Wallentin, Stephen Bullen, and John Green. This is a formidable book (over 1,100 pages), but it includes some serious discussions about how to make your worksheets and macros as fast-performing as possible. It also includes a free tool called PerfMon that you can use to time various parts of your coding to zero in on what you need to optimize.

Another tool that is highly recommended is one called FastExcel, an add-in that helps you speed up your workbooks. It includes profiling tools to measure timing and identify bottlenecks, among other features. It is available here:

http://www.decisionmodels.com/fastexcel.htm

Finally, Microsoft has published an excellent article (actually, three articles) on improving the performance of your workbooks. You can find it here:

http://msdn.microsoft.com/library/ff700515.aspx

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10984) applies to Microsoft Excel 2007, 2010, and 2013.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Better Ways to Insert Symbols

The traditional way to insert symbols into a document is to use the Symbol dialog box. This tip looks at ways other than the ...

Discover More

Shifting Objects Off a Sheet

One day you are just editing your worksheet like you normally do, then you see an error that says "Cannot shift object off ...

Discover More

Dealing with Large Numbers of Seconds

When adding values to a time to calculate a new time, you may naturally choose to use the TIME function. This can cause some ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Empty Cells Triggers Error

By default, Excel provides some feedback on your formulas so that you can easily locate potential errors. If you get tired of ...

Discover More

Appearance of Excel on the Taskbar

Do you want Excel to use a task button, on the Windows Taskbar, for each of your open worksheets? Then just make this simple ...

Discover More

Shortcut to Move between Two Worksheets

Moving between to adjacent worksheets is easy; Excel provides a shortcut key to do the trick. If you want to move between two ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven less than 7?

2017-11-20 23:45:13

Kevin

What was the main thing I get from reading the Microsoft articles?
Helper columns/rows are not the enemy. Use them to assist with speed improvements.


2017-11-10 01:30:18

Chris Barratt

I bought a copy of MS Office 2016 using your featured ad: a seamless down load and installation. But Microsoft have radically altered their Help system. Is there an 'easy' way to install anything similar to Office 2007 Help? Avoiding even more lengthy internet searches with slow download speeds would be a huge blessing!


2013-09-03 01:49:09

Mark Fitzgerald

The correct link to the Microsoft article is http://msdn.microsoft.com/en-us/library/office/ff700515.aspx


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.