+ Reply to Thread
Results 1 to 5 of 5

Average values using criteria

  1. #1
    Registered User
    Join Date
    03-28-2010
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    57

    Average values using criteria

    Hey guys,
    I have a problem with one of my data sets
    I have 2000 rows which have numbers which negative, positive or zero
    How do I average only the numbers that are not zero and divide by the standard deviation of those numbers (not including the zeros)
    For example, I have the following values in A1-A2000
    -0.1
    1.4
    0
    0
    0
    3
    0
    -1
    -50
    0
    all the way to 2000...
    I want to average only the cells that are not zero and divide by the standard deviation of those numbers. So I want my formula in b1 to be average(-0.1,1.4,3,-1,-50)/stdev(-.01,1.4,3,-1,-50)

    THANK YOU SO MUCH!

  2. #2
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Question about averaging values using criteria?

    This should work.

    Please Login or Register  to view this content.
    followed by the ever so important Ctrl + Shift + Enter

  3. #3
    Registered User
    Join Date
    03-28-2010
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    57

    Re: Average values using criteria

    Sorry I forgot one thing,
    I also have #div/0 in there several times. How do I also disregard that?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Average values using criteria

    Where do those errors come from?

    You probably would be better off error trapping the formulas in the A1:A2000 range and get it to return 0 instead.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Average values using criteria

    NBVC is right of course but for the sake of example if nothing else...

    =AVERAGE(IF(ISNUMBER(A1:A2000),IF(A1:A2000,A1:A2000)))/STDEV(IF(ISNUMBER(A1:A2000),IF(A1:A2000,A1:A2000)))
    confirmed with CTRL + SHIFT + ENTER

+ 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