Forum Discussion
heylookitsme
Dec 15, 2020Iron Contributor
Nested If Statement using Sum (Need to Optimize)
I am using Sum(IF( in order to sum data based on Column and Row lookup. Except every time I paste the formulas into the sheet it takes 5-10 mins for it to process. 10,000 cells max. What can I use th...
JKPieterse
Jan 27, 2021Silver Contributor
heylookitsme I can't say I reproduce this. Tables do have some perf hit, but it isn't too bad in the test I did (see test workbook attached).
Two sheets: A sheet with data in a table (10,000 rows) and the sumproduct formula
and an identical sheet with the same data, not in a table.
I ran VBA code doing this for both worksheets:
- Calc on auto
- Run 50 times:
- Filter the table using greater than 50 on the second column
- Unfilter the table
- Calc on manual
- Run 50 times:
- Filter the table using greater than 50 on the second column
- Unfilter the table
I get these results:
Calc | RangeFilter | TableFIlter |
auto | 1.840 | 2.068 |
manual | 0.584 | 0.490 |
With calculation ON, filtering the table takes longer than filtering the range
With calculation OFF, filtering the table takes less than filtering the range
But the difference isn’t that shocking.
If I delete all formulas and rerun the code I get this:
Even now, there is a difference between having calc on or off, but now filtering the range is quicker in both situations, by about 20%.