Using More CPU Power when Calculating

by Allen Wyatt
(last updated February 1, 2017)

5

Geoff has noticed that when calculating, Excel's CPU usage peaks at 50%. He wonders if there is any way to break through this barrier. He has tried setting Application.MultiThreadedCalculation.ThreadCount to various values, and has been able to bend the 50% limit out to about 58%, but there is still a large amount of untapped processing power available.

One way to change how much of your system resources are devoted to a particular task (such as running Excel) is to modify the importance placed on the task by the operating system. You can do this by displaying the Task Manager, right-clicking the Excel.exe process, and then choosing Set Priority. You will see six priority options available; Excel.exe is most likely set at a "Normal" priority level. You can increase the resources allocated to Excel.exe by the operating system by choosing either "Above Normal" or "High."

Note that you could also choose "Realtime," but this choice is not recommended. Why? Because then Windows will give precedence to Excel.exe at the expense of every other process on your system, including those processes used by the operating system itself. Essentially, this setting means that absolutely nothing else on your system can interrupt Excel. Sounds great, right? It can actually be a recipe for disaster because if Excel goes into an infinite loop or it takes inordinately long to finish some task (such as calculating a huge workbook), your entire system could lock up and you would be forced to reboot it.

Running at Realtime priority can also starve other system processes and prevent necessary system maintenance. Fortunately, it's rare that Excel will hold the CPU very long, so in most cases there won't be any adverse side effects, but nobody should ever boost any process to Realtime priority that's not explicitly designed for it.

Even if you were to boost Excel's priority to Realtime, you might not be able to get more than 50% usage. This is especially true if your machine has multiple CPUs or a multi-core CPU. How your system utilizes those additional CPUs (real or virtual) depends on several factors, the most important being the way in which the program (in this case Excel) is programmed to take advantage of threading on multiple CPUs. (Fortunately modern versions of Excel take advantage of multithreading opportunities very nicely.)

If you want to know more about how Excel uses memory, you can find detailed information at this helpful page:

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

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11056) 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

Printing a Style Sheet

Styles are a fantastic way to format your documents easily and consistently. At some point you may want to print out a list ...

Discover More

Selecting a Paper Size

Excel can print your worksheet on just about any paper size you can imagine. How you select the paper size you want used ...

Discover More

Nudging a Table

When laying out a page, you often need to move objects around to get them into just the right position. Word allows you to ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Odd Arrow Key Behavior

Press the up or down arrow keys, and you expect Excel to change which cell is selected. If this doesn't occur on your ...

Discover More

Disabling a Function Key

Function keys are used to perform common tasks in Excel. If you want to disable one of the function keys, it's rather easy to ...

Discover More

Determining Your Version of Excel

Want to find out exactly what version of Excel you are using? Here's how to get to the info.

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. 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 five less than 5?

2017-02-02 23:15:11

David Gray

Lowering the dispatch priority of less important tasks absolutely can improve overall performance. The problem is that, by itself, Task Manager forgets all about those settings when you restart, or if the process is one that runs intermittently.

A solution exists, though, in the form of PRIO, the Process Priority Saver, freely available at https://www.prnwatch.com/prio/. I have been using it since I discovered it about a year ago, and it works quite well.


2017-02-02 04:44:19

James H

I haven't tested this theory, but could reducing the importance of other .exe files to low or below normal also help divert processing power to Excel?


2017-02-02 04:09:39

Warwick W

Even better, if this hasn't been done already, is to reduce the CPU requirements. A number of detailed approaches can be used in particular instances, but two general ones that can be applied are:

1. Put "Application.ScreenUpdating=False" as early as possible in the macro and turn it on again at the end of the macro, by repeating the above line but substituting "True" for "False". I reduced production of a print-ready 52-page brochure generated from many tables of a database from about 15 minutes to about 2 minutes with this alone. It cuts out the considerable processing involved in continually updating the screen. It has the side benefit of not seeing the screen go wild in long-running macros.

2. Well-documenting the macro with comments is very praiseworthy and can make it much easier to pick the program up at a later time. However, VBA is an interpretive language and goes through interpreting each token (bit) of each line it passes through, no matter what it contains, including comments. So keep comments outside of very compute-intensive parts of the macro. Put such comments at the start of these parts outside of the intensive loops.

These steps alone will often take away the need to do anything about increasing the percentage of the processor's power used by the progrom. They will certainly cause much better performance even if other measures are needed.


2013-10-02 09:29:54

Glenn Case

I find that if I have a number of Excel files open, macro execution can become very slow. It helps significantly in such cases to open a second instance of Excel and execute the macro from the new instance. This typically results in orders of magnitude faster execution.


2013-09-03 08:50:12

Bryan

Is the link right? The article is about CPU and the link is about memory.

The article says "Fortunately modern versions of Excel take advantage of multithreading opportunities very nicely." -- does this apply to VBA? It's darn rare that I ever have calculation times with worksheet formulas, but I do often have long times when running involved macros. With Excel 2007, I've never gotten more than 50% usage, or 100% of one core.


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.