Results 1 to 4 of 4

Thread: get standard deviation from every 1st, 6th and 10th cell in column
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Aug 2017
    Posts
    114
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

    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

  2. #2
    MrExcel MVP Eric W's Avatar
    Join Date
    Aug 2015
    Location
    Bountiful, UT
    Posts
    8,659
    Post Thanks / Like
    Mentioned
    42 Post(s)
    Tagged
    5 Thread(s)

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

    Try:

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

    and confirm it by pressing Control+Shift+Enter.
    Cheers,
    Eric

    When you eliminate the impossible, whatever remains, however improbable, must be the truth.

    -Posting guidelines, forum rules, terms of use, FAQs, BB codes, See how to search the forum
    -Post a screen shot with the HTML Maker

  3. #3
    Board Regular
    Join Date
    Aug 2017
    Posts
    114
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

    Thanks Eric
    Can I do it vba?

  4. #4
    MrExcel MVP Eric W's Avatar
    Join Date
    Aug 2015
    Location
    Bountiful, UT
    Posts
    8,659
    Post Thanks / Like
    Mentioned
    42 Post(s)
    Tagged
    5 Thread(s)

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

    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.
    Cheers,
    Eric

    When you eliminate the impossible, whatever remains, however improbable, must be the truth.

    -Posting guidelines, forum rules, terms of use, FAQs, BB codes, See how to search the forum
    -Post a screen shot with the HTML Maker

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •