Speeding up a STDEV calculation

Reboshua

Board Regular
Joined
Jan 23, 2015
Messages
88
=IFERROR(STDEV(IF(('All Data'!$F:$F=[@Stuffername])*('All Data'!$AE:$AE<6),'All Data'!$AB:$AB)),"")

The above is the equation I'm using to get the standard deviation of values on a separate sheet with several conditions.

The other sheet has about 21000 rows of data.

I'm doing the STDEV calc above on a table and when I try and calculate this column, it takes 90 seconds or so.

Why does the array take so very long to calculate and is there anything I can do to markedly speed it up?

Thanks!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
One thing to try is don't reference whole columns in your formula. Instead of $F:$F maybe $F1:$F22000.
When you use IFERROR and reference a whole column the IFERROR function runs on all 1 million plus rows.
 
Upvote 0
=IFERROR(STDEV(IF(('All Data'!$F:$F=[@Stuffername])*('All Data'!$AE:$AE<6),'All Data'!$AB:$AB)),"")
[....]
Why does the array take so very long to calculate and is there anything I can do to markedly speed it up?

For starters, try:

=IFERROR(STDEV(IF(('All Data'!$F$1:$F$21000=[@Stuffername])*('All Data'!$AE$1:$AE$21000<6),'All Data'!$AB$1:$AB$21000)),"")

Adjust 21000 as needed. And maybe $F$1 should be $F$2, if row 1 has titles.

You were asking Excel to process 1+ million rows multiple times for each STDEV formula.

You were also asking Excel create multiple temporary arrays of 8MB each.
 
Upvote 0
Thank you for replying - much appreciated.

I thought that, because it's a table, it would know to restrict the calcs to only the rows in the table, but I guess not.

Your suggestion dropped the calculation time from 90 seconds to about 15, that's massive.

Cheers!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top