+ Reply to Thread
Results 1 to 6 of 6

STDEVIF Equivalent

  1. #1
    Registered User
    Join Date
    06-13-2011
    Location
    Boulder, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    61

    STDEVIF Equivalent

    I know there have been previous posts of this but I personally haven't been able to find a solution to help me solve my problem. I have data which is reported by frame number but for many trajectories. I currently use the averageif function to group the data based off frame number and then calculate the average distance traveled by all particles in that frame. I would like to do the same thing now but with the standard deviation. The Frame number is reported in column A, and I would like to group all of the data by frame number and then calculate the standard deviation for each frame. I've attached a sample workbook to view the formatting of the worksheet.
    Attached Files Attached Files
    Last edited by Impartial Derivative; 06-24-2011 at 12:25 PM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: STDEVIF Equivalent

    Try this user defined function.

    Please Login or Register  to view this content.
    Martin

  3. #3
    Registered User
    Join Date
    06-13-2011
    Location
    Boulder, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: STDEVIF Equivalent

    Martin,

    That code looks great but when I insert it in a new module save in VBA and then try to execute it in my file I receive a #NAME error.

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: STDEVIF Equivalent

    See the attachment for an example.
    Attached Files Attached Files

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: STDEVIF Equivalent

    How about just an array formula? In M4 and copy down,

    =STDEV(IF($A$1:$A$270=K4, $G$1:$G$270))

    The formula MUST be confirmed with Ctrl+Shift+Enter.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    06-13-2011
    Location
    Boulder, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: STDEVIF Equivalent

    Quote Originally Posted by shg View Post
    How about just an array formula? In M4 and copy down,

    =STDEV(IF($A$1:$A$270=K4, $G$1:$G$270))

    The formula MUST be confirmed with Ctrl+Shift+Enter.
    Shg,

    I was thinking about using an array formula but I wasn't positive if it would work. I think between both answers provided I should be able to calculate what I need.However, in my macro I am having trouble correcting the syntax to have the formula apply any data set independent of the size of the data. I attempted the following but had no luck:
    Please Login or Register  to view this content.
    Thanks again
    Last edited by Impartial Derivative; 06-24-2011 at 12:38 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1