get standard deviation from every 1st, 6th and 10th cell in column

ThomasOES

Board Regular
Joined
Aug 29, 2017
Messages
174
Hello

I have a column of data. The # of rows are always multiples of 10.
How to get the standard deviation from the cells in each 1st, 6th and 10th row?
For example if I had 100 rows. I would want the standard deviation from rows 1,6,10,11,16,20,21,26,30...91,96,100

Thanks
Tom
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try:

=STDEV(IF(MOD(ROW(A1:A20),10)={0,1,6},A1:A20))

and confirm it by pressing Control+Shift+Enter.
 
Upvote 0
Um, sure . . .

Code:
Sub test1()


    Range("C1") = Evaluate("=STDEV(IF(MOD(ROW(A1:A20),10)={0,1,6},A1:A20))")
    
End Sub
You could write a loop that looks at all of your rows, picks out the right numbers, load them to an array, then send that to WorksheetFunction.STDEV, but unless you have a specific reason to do it that way, I'd stick with the Evaluate.
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,342
Members
448,570
Latest member
rik81h

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