+ Reply to Thread
Results 1 to 14 of 14

Calculate average and standard deviation for each year and exclude 0s

  1. #1
    Registered User
    Join Date
    11-14-2013
    Location
    Sacramento
    MS-Off Ver
    Excel 2010
    Posts
    42

    Post Calculate average and standard deviation for each year and exclude 0s

    I have a column A with years 2010-2015, column B with data. How do I calculate the average for each year and exclude the 0s when calculating average.

    Also how do I do the mean, and standard deviation for them?

  2. #2
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: Calculate average and standard deviation for each year and exclude 0s

    Hi Excelas,

    You must have Years mentioned somewhere to calculate against each year so you should now for which year you are calculating average.

    you can use averageifs or averageif depending on how many criteria you may have later on.


    Cheers!!!

    Anil Dhawan
    Thanks,
    Anil Dhawan


    Click *Add Reputation to say "Thanks" and don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved) if you are satisfied.

    Don't stop when you are tired. STOP when you are done!

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculate average and standard deviation for each year and exclude 0s

    Quote Originally Posted by excelas88 View Post
    Also how do I do the mean, and standard deviation for them?
    Mean is usually a synonym for average. If that's not your intent then please define "mean".

    If you want standard deviation for a specific year, excluding zeroes, then you can use an array formula like this:

    =STDEV(IF(A$2:A$100=D2,IF(B$2:$B100<>0,B$2:B$100)))

    confirm with CTRL+SHIFT+ENTER

    where D2 contains a specific year

    You can replace STDEV with AVERAGE in that formula for an average with the same conditions or use AVERAGEIFS as suggested
    Audere est facere

  4. #4
    Registered User
    Join Date
    11-14-2013
    Location
    Sacramento
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Calculate average and standard deviation for each year and exclude 0s

    I'm not sure how to do that. I have added a spreadsheet as well. Thanks for the reply
    Attached Files Attached Files

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Calculate average and standard deviation for each year and exclude 0s

    Can you post a SMALL sample file and show us what result you expect?

    A SMALL file will have about 20 rows worth of data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    11-14-2013
    Location
    Sacramento
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Calculate average and standard deviation for each year and exclude 0s

    I have attached the file.

  7. #7
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: Calculate average and standard deviation for each year and exclude 0s

    For Average, lets assume you have table summary starting from I1. and I2 to going down you have years mentioned.

    e.g.

    I2 = 2009 J2 = "=AVERAGEIFS(E:E,A:A,I2,E:E,"<>0")"
    I3 = 2010 J3 = "=AVERAGEIFS(E:E,A:A,I3,E:E,"<>0")"


    Hope this will solve your purpose of Average.

  8. #8
    Registered User
    Join Date
    11-14-2013
    Location
    Sacramento
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Calculate average and standard deviation for each year and exclude 0s

    Thanks! That works for averages. How about standard deviation?

    I noticed there are multiple formulas on excel for standard deviation.

    Thanks

  9. #9
    Registered User
    Join Date
    11-14-2013
    Location
    Sacramento
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Calculate average and standard deviation for each year and exclude 0s

    Can anyone help with standard deviation please?

    Thanks

  10. #10
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: Calculate average and standard deviation for each year and exclude 0s

    Hey - I guess in Post 3 you have got the Standard Deviation result? Is that not working?? Sorry i did not test it but can you please check once and confirm if that works or not?

  11. #11
    Registered User
    Join Date
    11-14-2013
    Location
    Sacramento
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Calculate average and standard deviation for each year and exclude 0s

    Yes I tried it and it did not work.

  12. #12
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculate average and standard deviation for each year and exclude 0s

    Quote Originally Posted by excelas88 View Post
    Yes I tried it and it did not work.
    What was the problem?

    The suggested formula is an "array formula" and you need to confirm with CTRL+SHIFT+ENTER

    To do that put the formula in a cell, select that cell then press F2 key to slect formula and hold down CTRL and SHIFT keys while pressing ENTER. If done correctly you will see curly braces like { and } around the formula in the formula bar

  13. #13
    Registered User
    Join Date
    11-14-2013
    Location
    Sacramento
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Calculate average and standard deviation for each year and exclude 0s

    Ah, thats it!

    I had to press the control shift and enter to make the formula work. Thanks for the help guys! Much appreciated

  14. #14
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: Calculate average and standard deviation for each year and exclude 0s

    Yeah I was also thinking why it is not working whereas the function seems to be correct.

    Now, please marke this thread as SOLVED and say Thanks to those who gave you solution by adding Add Reputation on left side of the page.


    Cheers!!!
    Anil

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 12
    Last Post: 04-04-2013, 11:02 PM
  2. Calculating Five year rolling standard deviation
    By Yaaseen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-19-2012, 02:21 AM
  3. Average and Standard Deviation Question
    By ryankarmouta in forum Excel General
    Replies: 1
    Last Post: 10-22-2011, 01:19 AM
  4. Average & Standard Deviation Loop
    By smadsen99 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-01-2011, 06:03 PM
  5. [SOLVED] Weighted Average Standard Deviation
    By kthenning in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-02-2005, 12:05 PM

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