Calculating the Standard Deviation within a Data Set over Variable Ranges

rwmill9716

Active Member
Joined
May 20, 2006
Messages
493
Office Version
  1. 2013
Platform
  1. Windows
I have a set of data defined by dates collected in Column I and measured values in Column J. I need the average and standard deviation of that data by week. As presented, Column K identifies the week number, Column L a composite of the year with that week number, Column M the last day in that week (contained in the data set) and Column N the average value for that week. I need a formula or macro that calculates in Column N the standard deviation for that week, which would be 2.34 for the first week shown.

Thanks for your help,

Ric


Excel 2012
IJKLMN
2=WEEKNUM(I4)=YEAR(I4)&"_"&K4=IF(K4=K5,"",I4)=IF(M4="","", AVERAGEIF($L$4:$L$5000,L4,$J$4:$J$5000))
3DateCompositeWeek NumberDateAvg by day across tanks
401/02/111222011_2
501/02/111622011_2
601/04/111322011_2
701/04/111822011_2
801/06/111322011_2
901/06/111622011_201/06/1114.67
1001/09/111232011_3
1101/09/11932011_3
1201/11/111132011_3
1301/11/111332011_3
1401/13/111532011_3
1501/13/111032011_301/13/1111.67
1601/16/111742011_4
1701/16/111542011_4
1801/18/111542011_4
1901/18/111242011_401/18/1114.75
2001/23/112252011_5
2101/23/112052011_5
2201/25/111952011_5
2301/25/111652011_5
2401/27/111852011_5
2501/27/112152011_501/27/1119.33
2601/30/111962011_6
2701/30/112362011_6
2802/01/111862011_6
2902/01/111962011_6
3002/03/111962011_6
3102/03/111962011_602/03/1119.50
3202/06/112072011_7
3302/06/112472011_7
3402/08/112272011_7
3502/08/112672011_7
3602/10/111972011_7
3702/10/112272011_702/10/1122.17
Salt Tanks
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
A Pivot Table would make quick work of this task. Would you accept a PT?
 
Upvote 0
If you don't want a PT, you could try this in O3 to calculate the StDev. Copy down as necessary.

O
2StDev
3

<colgroup><col style="width: 25pxpx"><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet23

Array Formulas
CellFormula
O3{=IF(M3="","",STDEV.S(IF($L$3:$L$36=L3,$J$3:$J$36)))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try to enter the {} manually yourself.

<tbody>
</tbody>
 
Upvote 0
I'm glad it worked for you. You're welcome.
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,779
Members
449,049
Latest member
greyangel23

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