Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

SUMPRODUCT Function cause high memory usage in Excel 2010

$
0
0

Hi,

I run 32bit Excel 2010 on Windows 7. I have a 140KB Excel file that I've been working on. While I was making copies of the file (to save different iterations of my work - only one open at a time), I noticed that the Excel memory usage spiked. It would go from an Ok 50,000K memory usage to at least 475,000K, maybe even 600,000K!

I started to track down the cause. I have formulas on Worksheet A that reference raw data on Worksheet B. Worksheet B uses an OLE DB link and SQL query to pull in data from an SQL database. Right now, this is only 117 rows. We're not talking a huge dataset here.

Most of the formulas on Worksheet A involve different dates and people. So the same basic formula is copied many times on the Worksheet and either the date references or the people references change. The following formula is part of an IF function and I tracked it down as the cause of the memory spike by a process of elimination. It did use named ranges, but I took those out to see if it was part of the memory issue (which it wasn't).

=SUMPRODUCT(WSheetB!$L:$L,(WSheetB!$B:$B=$A21)*(WSheetB!$Y:$Y<=$U4)*(WSheetB!$E:$E>=$U5)*((WSheetB!$W:$W=C2)+(WSheetB!$W:$W=D2)+(WSheetB!$W:$W=E2))

The formula sums one of the columns based on matching a number of row criteria, with the last set being OR(+) matches instead of AND. A21 is a text match, as are C2, D2 and E2. U4 and U5 are number evaluations.

Once the formula is calculated, the memory spikes and the more copies/variations of the formula, the more the memory requirement rises. The processor also seems to take a hit and things slow down.

Anyone have any ideas? Even if it's to do the same calculation in a different way, using a different function.


Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>