To fix the "Excel Out of Memory" error, you must first free up system RAM by closing unnecessary background applications and then optimize your workbook by removing excessive formatting, deleting unused cells, and converting volatile formulas to static values. This error occurs when Excel cannot allocate enough contiguous memory to perform a specific operation, regardless of how much total RAM your computer has.
What You'll Need
- A computer running Microsoft Excel (Windows or macOS).
- Administrative privileges to access Task Manager or Activity Monitor.
- A backup copy of your workbook before attempting large-scale deletions.
Step-by-Step
- Close Unnecessary Applications
Excel competes with other open software for system memory. Open the Task Manager (Ctrl + Shift + Esc on Windows) or Activity Monitor (Cmd + Space, then type Activity Monitor on Mac). Identify applications consuming high amounts of memory—such as web browsers with many open tabs or video editing software—and close them. This provides Excel with a larger pool of available RAM to handle your calculations. - Check for 32-bit vs. 64-bit Excel
The 32-bit version of Excel is limited to using a maximum of 2GB to 4GB of RAM, regardless of how much your PC has installed. To check your version, go to File > Account > About Excel. If it says "32-bit" and you are working with massive datasets, the only permanent solution is to uninstall Office and install the 64-bit version, which can access virtually all available system memory. Note that menu labels may differ slightly depending on your version of Office. - Clear Excessive Formatting
One of the most common causes of memory bloat is "ghost" formatting. If you applied a color or border to an entire column (over 1 million rows), Excel tracks every single cell. To fix this, select the first empty row below your actual data, press Ctrl + Shift + Down Arrow to select everything to the bottom of the sheet, right-click, and select Delete. Repeat this process for columns to the right of your data. Save the workbook and restart Excel to reclaim the memory. - Reduce Volatile Functions
Functions like OFFSET, INDIRECT, TODAY, and NOW are "volatile," meaning they recalculate every time any cell in the workbook changes. In a large sheet, this creates a constant loop of memory usage. Replace OFFSET with INDEX/MATCH and replace INDIRECT with direct references where possible. If you have thousands of these formulas, your CPU and RAM will be under constant strain, leading to the out-of-memory crash. - Convert Formulas to Values
If you have complex calculations that do not need to change once they are finished, convert them to static values. Select the range of formulas, copy them (Ctrl + C), right-click the same area, and select Paste Special > Values. This removes the computational burden from Excel's memory engine, as it no longer needs to store the logic of the formula, only the resulting number. - Disable Hardware Graphics Acceleration
In some versions of Excel, the way the software interacts with your graphics card can cause memory leaks. Go to File > Options > Advanced. Scroll down to the Display section and check the box for "Disable hardware graphics acceleration." Click OK and restart the application. This forces Excel to use standard rendering, which can stabilize memory usage on some systems. - Manage Add-ins
Third-party add-ins often run in the background and consume memory. Go to File > Options > Add-ins. At the bottom, select "COM Add-ins" from the Manage dropdown and click Go. Uncheck any add-ins you do not actively use. Restart Excel to see if the memory error persists.
Common Mistakes
A frequent mistake is assuming that adding more physical RAM to a computer will automatically solve the problem. If you are using the 32-bit version of Excel, the software cannot "see" or use RAM beyond its hard-coded limit. Upgrading your hardware without upgrading your software version is a waste of resources in this specific scenario.
Another common error is using "Select All" (Ctrl + A) to apply formatting to a sheet. When you color the background of an entire worksheet, Excel creates a record for every single cell in the grid. Even if the cells are empty, the formatting metadata consumes memory. Always apply formatting only to the specific range containing your data.
Users also often forget to save a backup before performing the "Delete Rows/Columns" cleanup. If you accidentally delete actual data while trying to clear ghost formatting, you cannot undo the action once the file is saved and closed. Always work on a copy of the file when performing deep cleaning.
Tips
To prevent memory issues in the future, use Excel Tables (Ctrl + T). Tables are more efficient than standard ranges because they dynamically expand and contract, meaning Excel only tracks the cells actually being used rather than the entire surrounding area.
Consider using Power Query (Data > Get & Transform Data) for large datasets. Power Query processes data in a separate engine outside the main Excel grid, allowing you to clean, filter, and transform millions of rows without loading them all into the active worksheet memory. This is the most professional way to handle "Big Data" within Excel.
Save your files in the .xlsx or .xlsb (Binary) format. The .xlsb format is particularly useful for very large files because it stores data in binary rather than XML, which often results in smaller file sizes and faster loading times, reducing the initial memory spike when opening the document.
Troubleshooting
If you have followed all the steps and the error still occurs, try opening Excel in Safe Mode. Hold the Ctrl key while double-clicking the Excel icon. If the file opens without the error, the problem is likely a corrupted add-in or a custom startup script. You can then disable add-ins one by one to find the culprit.
If the error only happens with one specific file, the file may be corrupted. Try the "Open and Repair" feature: go to File > Open > Browse, select the file, click the arrow next to the Open button, and choose Open and Repair. This can remove corrupted metadata that might be causing the memory leak.
If the error occurs across all files, check for pending Windows or Office updates. A known bug in a specific build can cause memory leaks, and a patch from Microsoft is often the only fix. Go to File > Account > Update Options > Update Now.
Frequently Asked Questions
Why do I get this error if I have 32GB of RAM?
This usually happens because you are using the 32-bit version of Excel, which has a memory limit of roughly 2-4GB regardless of your system's total RAM. Upgrading to 64-bit Excel allows the program to use all your available memory.
Does clearing the cache help with memory errors?
Clearing the temporary files folder (Temp) in Windows can sometimes help if the system is struggling with virtual memory (paging files), but it rarely fixes an internal Excel memory limit issue.
Can a printer driver cause an out of memory error?
Yes, surprisingly. Excel communicates with the default printer driver to determine page breaks and margins. If the driver is corrupted or incompatible, it can cause Excel to hang or report memory errors during printing or page layout changes.
Will converting my file to .csv fix the problem?
A .csv file removes all formulas and formatting, which will stop the memory error, but you will lose all your logic and styling. It is a last resort for data recovery, not a long-term solution for a working workbook.
Is there a limit to how many formulas a sheet can have?
There is no hard numerical limit, but there is a practical limit based on your RAM. When formulas are complex and interdependent, Excel creates a "calculation chain" in memory; if this chain becomes too large, the system will run out of memory.