Goal: Finding the STDEVP of Filtered Data and automatically excluding cells with error messages

SummerIntern

New Member
Joined
Jun 8, 2011
Messages
2
Hello there,

I am working with a spreadsheet with about 90 columns and over 14,000 rows of data pertaining to product sales, share of market, and various changes over periods of time (in columns) for specific locations (rows).

My goal: I would like to be able to quantify the average product volume growth between time frames and categorize the locations based on their standard deviation from the mean.

My problem: For whatever reason, the data isn't continuous. Some locations might not have been reporting data before a certain time period, so when I look for the % Volume Change since Year Ago, some of the cells will get error messages because they cannot divide by zero. From what I can tell, if any error messages exist, the subtotal function will not be able to work properly.

Can you think about any ways to get around this problem? Could I be overlooking a simple solution?

Thank you in advance.
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hello there,

I am working with a spreadsheet with about 90 columns and over 14,000 rows of data pertaining to product sales, share of market, and various changes over periods of time (in columns) for specific locations (rows).

My goal: I would like to be able to quantify the average product volume growth between time frames and categorize the locations based on their standard deviation from the mean.

My problem: For whatever reason, the data isn't continuous. Some locations might not have been reporting data before a certain time period, so when I look for the % Volume Change since Year Ago, some of the cells will get error messages because they cannot divide by zero. From what I can tell, if any error messages exist, the subtotal function will not be able to work properly.

Can you think about any ways to get around this problem? Could I be overlooking a simple solution?

Thank you in advance.
Try something like this...

Book1
AB
4header1header2
5X56
6X87
7Y_
8X#DIV/0!
9X0
10X97
11Y89
12Y47
13X55
Sheet1

Array entered**:

=STDEVP(IF(ISNUMBER(B5:B13),IF(SUBTOTAL(2,OFFSET(B5,ROW(B5:B13)-ROW(B5),0,1)),B5:B13)))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0
If you're using Excel 2010, have a look at the AGGREGATE function. Off hand, I don't know whether it's available for 2007. Also, I think Biff's formula can be shortened...

=STDEVP(IF(SUBTOTAL(2,OFFSET(B5:B13,ROW(B5:B13)-ROW(B5),0,1)),B5:B13))

...confirmed with CONTROL+SHIFT+ENTER.
 
Upvote 0
Dominic and T. Valko,

Thank you both very much! The formula you both gave me worked wonders! So far, I have had success applying it to different areas and with different functions in the spreadsheet!

Thanks so much!
 
Upvote 0
Dominic and T. Valko,

Thank you both very much! The formula you both gave me worked wonders! So far, I have had success applying it to different areas and with different functions in the spreadsheet!

Thanks so much!
You're welcome. Thanks for the feedback! :cool:
 
Upvote 0
Also, I think Biff's formula can be shortened...

=STDEVP(IF(SUBTOTAL(2,OFFSET(B5:B13,ROW(B5:B13)-ROW(B5),0,1)),B5:B13))

...confirmed with CONTROL+SHIFT+ENTER.
I originally used SUBTOTAL(9 and got the #DIV/0! error so I added the ISNUMBER but then decided to go with SUBTOTAL(2 but left the ISNUMBER in there!
 
Upvote 0
No, it's not. And I don't have Excel 2010 to be able play with it! :(

Thanks for letting me know, Biiff.

I originally used SUBTOTAL(9 and got the #DIV/0! error so I added the ISNUMBER but then decided to go with SUBTOTAL(2 but left the ISNUMBER in there!

Been there, done that. :-)
 
Upvote 0

Forum statistics

Threads
1,224,504
Messages
6,179,142
Members
452,892
Latest member
JUSTOUTOFMYREACH

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