Written by Allen Wyatt (last updated August 17, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
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:
https://msdn.microsoft.com/library/FF700515.aspx
The article was written specifically for Excel 2010, but it is still applicable to other modern versions of the program.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10984) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
It can be frustrating if you expect to use some of Excel's tools normally available on the ribbon, but those tools are ...
Discover MoreExcel allows you to define the data in a worksheet as a table. Doing so can provide some clear benefits over simply ...
Discover MoreReports and other formal documents are often distributed in PDF format so that they can be read and printed on a variety ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-08-17 05:33:44
Henry Kafeman
FYI - (as per Mark Fitzgerald) There is a more up to date version of the referenced article here (currently last updated 30th Mar 2022):
https://docs.microsoft.com/en-us/office/vba/excel/concepts/excel-performance/excel-improving-calculation-performance
I have already used the VBA code in the "Measuring calculation time" section which was easy to implement and use.
It also links to:
https://docs.microsoft.com/en-us/office/vba/excel/concepts/excel-performance/excel-performance-and-limit-improvements
2019-02-12 04:14:27
Mark Fitzgerald
For Excel 2013 and 2016 users this article contains more up to date information: https://docs.microsoft.com/en-us/office/vba/excel/concepts/excel-performance/excel-improving-calcuation-performance.
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2023 Sharon Parq Associates, Inc.
Comments