+ Reply to Thread
Results 1 to 26 of 26

Calculate average withouot incorporating sub average

  1. #1
    Registered User
    Join Date
    06-14-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    84

    Calculate average withouot incorporating sub average

    Hi, for my work I have to calculate the average of cases for a year and the data is set up with monthly average in the row. I also need to not incorporate the cells with 0 or a dash in them because they are referenced to another worksheet with formula. The data is set up this way:

    dates Cases
    1/08 1
    1/15 3
    1/25 4
    1/30 2
    1st period: =IF(SUM(B2:B5)>0,AVERAGE(B2:B5),0)
    (average)
    . ((the next 11 mos. are repeated)
    .
    .
    12/1 -
    12/8 -
    12/16 -
    12/23 -
    12/30 -
    12th prd: =IF(SUM(B76:B79)>0,AVERAGE(B76:79),0)
    (average)

    Average: (Average up to the date)


    At the end, I want to calculate the average "up to date", but I'm having problem selecting range with just the subaverage cells because Excel won't let me. Can you please help me calculating the average up to date?

    Thank you!
    Last edited by ybu1106; 06-15-2010 at 09:48 AM.

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

    Re: Calculate average withouot incorporating sub average

    So are you wanting the average of all the averages?

    Is so, is there anything in an adjacent cell to the subaverage that indicates that it is an average calculation?
    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.

  3. #3
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Calculate average withouot incorporating sub average

    Doesn't that formula workjust as well,

    =IF(SUM(B2:B79)>0,AVERAGE(B2:79),0)

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Calculate average withouot incorporating sub average

    Bob, fixed:

    =IF(SUM(B2:B79)>0,AVERAGE(B2:B79),0)
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  5. #5
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Calculate average withouot incorporating sub average

    Quote Originally Posted by Cheeky Charlie View Post
    Bob, fixed:

    =IF(SUM(B2:B79)>0,AVERAGE(B2:B79),0)
    Ta! (plus some more as it needs to be at least 10 characters).

  6. #6
    Registered User
    Join Date
    06-14-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    84

    Re: Calculate average withouot incorporating sub average

    "1st Period" that whole column is highlighted and bolded, as an indication of Average for the period
    Also, I thought about using color referencing for criteria in an IF function, but that seems too complicated since it deals with VBA.

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

    Re: Calculate average withouot incorporating sub average

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  8. #8
    Registered User
    Join Date
    06-14-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    84

    Re: Calculate average withouot incorporating sub average

    Here is a dummy workbook. Please pay attention to words in RED. Thanks
    Attached Files Attached Files

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

    Re: Calculate average withouot incorporating sub average

    Perhaps in B82:

    =AVERAGE(IF(ISNUMBER($A$6:$A$80),IF(B$6:B$80<>0,B6:B80)))

    confirmed with CTRL+SHIFT+ENTER not just ENTER and copied across.
    Last edited by NBVC; 06-14-2010 at 01:56 PM. Reason: adjusted formula for checking which are numbers.

  10. #10
    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: Calculate average withouot incorporating sub average

    You can change the formulas in B11:C11 and like cells to

    =SUBTOTAL(1, B6:B10)

    Then the formula in B82 is

    =SUBTOTAL(1, B4:B80)
    Entia non sunt multiplicanda sine necessitate

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

    Re: Calculate average withouot incorporating sub average

    Note: I adjust formula above to average the non-subtotals, instead of the subtotals as per your original post.

  12. #12
    Registered User
    Join Date
    06-14-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    84

    Re: Calculate average withouot incorporating sub average

    Hi, I just copied and pasted your formula (=AVERAGE(IF(ISNUMBER($A$6:$A$80),IF(B$6:B$80<>0,B6:B80)))) into B82, but I got "0"

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

    Re: Calculate average withouot incorporating sub average

    Did you confirm it with CTRL+SHIFT+ENTER ? You should see { } brackets appear around the formula.

  14. #14
    Registered User
    Join Date
    06-14-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    84

    Re: Calculate average withouot incorporating sub average

    yes I did, when I "ctrl + shift + enter" nothing happens.

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

    Re: Calculate average withouot incorporating sub average

    See attached:

    You need to make sure the cell is active... hit F2, then confirm with CSE...
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    06-14-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    84

    Re: Calculate average withouot incorporating sub average

    That is really weird, when I click on B82 and hit enter, the number disappears and is replaced with " - " on the corner, it says that it is an error and the caution symbol pops up, which comes down with this drop list (Unprotected formula, lock cell, help on error, ignore error, edit in formula bar, error checking options, show formula in audit bar)

    Do you think its the setting on my Excel? firewall? or something that is preventing me from CSE?

  17. #17
    Registered User
    Join Date
    06-14-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    84

    Re: Calculate average withouot incorporating sub average

    That is really weird, when I click on B82 and hit enter, the number disappears and is replaced with " - " on the corner, it says that it is an error and the caution symbol pops up, which comes down with this drop list (Unprotected formula, lock cell, help on error, ignore error, edit in formula bar, error checking options, show formula in audit bar)

    But when I click on the cell, F2, CSE the number comes back....

    Do you think its the setting on my Excel? firewall? or something that is preventing me from CSE?

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

    Re: Calculate average withouot incorporating sub average

    No, it is just warning you that the cell is not protected and than someone can overwrite it.

    Excel is sometimes seemingly haphazard about displaying this.. it sometimes depends on what is in adjacent cells.. but just choose to ignore the error.

    the "-" is because you formatted the cell to display a dash when you get a 0 result... which is incorrect for this formula... you have to use CSE keys to get right result.

  19. #19
    Registered User
    Join Date
    06-14-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    84

    Re: Calculate average withouot incorporating sub average

    Thanks for your help!

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

    Re: Calculate average withouot incorporating sub average

    You are welcome,

    Please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  21. #21
    Registered User
    Join Date
    06-14-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    84

    Re: Calculate average withouot incorporating sub average

    Hi, actually I just double checked that the average doesn't come out right, it is a little bit off.

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

    Re: Calculate average withouot incorporating sub average

    Then you want the averages of the Subaverages????

    =AVERAGE(IF(ISNUMBER(SEARCH("PRD",$A$6:$A$80)),IF(B$6:B$80<>0,B6:B80)))

    confirmed with CSE...

    If not, please elaborate as to what you expect as a result and based on what

  23. #23
    Registered User
    Join Date
    06-14-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    84

    Re: Calculate average withouot incorporating sub average

    Oh, I didn't know there would be any discrepancies with getting avg of subaverages and average of of all the dates (not including subaverages). Where might you think the discrepancies come from? I mean it is only a little bit off, but it is too big of a variance for rounding. Thanks!

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

    Re: Calculate average withouot incorporating sub average

    I am not a mathematician, but I think there will be a difference when you are averaging averages as opposed to averaging original numbers...

    See here: http://wiki.answers.com/Q/Is_an_aver...rages_accurate

  25. #25
    Registered User
    Join Date
    06-14-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    84

    Re: Calculate average withouot incorporating sub average

    Alright! Thanks for all your help! I really appreciated....You know you can make at least $200k/yr with the knowledge/skills you have! The world needs more people like you! Once again, thank you!

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

    Re: Calculate average withouot incorporating sub average

    Can you find me that job please . I sure can't find it!

+ 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