+ Reply to Thread
Results 1 to 13 of 13

Average Formula - Include zeros

  1. #1
    Registered User
    Join Date
    08-19-2009
    Location
    Winnipeg, Manitoba, Canada
    MS-Off Ver
    Excel 2003
    Posts
    90

    Average Formula - Include zeros

    Hello,

    i had a previous thread ....which was solved ....

    http://www.excelforum.com/excel-prog...e-formula.html


    The issue I am having is ...there are certain rows in my WB tht will have a "0.00" value ... when I use this formula:

    Please Login or Register  to view this content.
    I get a DIV/0 error ... how can a resolve this ...

    I have tried the following but it doesn't seem to work ...

    Please Login or Register  to view this content.
    Thank you in advance.....
    Last edited by arvin; 07-07-2010 at 02:09 PM. Reason: Issue has been solved

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

    Re: Average Formula - Include zeros

    It works for me if all of D7:DC7 are =0 then you should get 0.

    How is it not working... error or wrong value?
    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 sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Average Formula - Include zeros

    Hi,

    This will return the average of cell D10:DC10 if the relative cell in row 7 contains "Planned". It should include cells in row 10 that contain zero.

    =AVERAGE(IF(D7:DC7= "Planned",D10:DC10,""))

    entered using CTRL, SHIFT and ENTER
    Last edited by sweep; 07-07-2010 at 10:03 AM.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

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

    Re: Average Formula - Include zeros

    Try

    =IF(SUM((D26:DC26="Planned")*(D7:DC7))<>0,AVERAGE(IF((D26:DC26="Planned")*(D7:DC7),D7:DC7)),0)
    Audere est facere

  5. #5
    Registered User
    Join Date
    08-19-2009
    Location
    Winnipeg, Manitoba, Canada
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Average Formula - Include zeros

    Quote Originally Posted by daddylonglegs View Post
    Try

    =IF(SUM((D26:DC26="Planned")*(D7:DC7))<>0,AVERAGE(IF((D26:DC26="Planned")*(D7:DC7),D7:DC7)),0)
    This gave me a "#VALUE" error....

  6. #6
    Registered User
    Join Date
    08-19-2009
    Location
    Winnipeg, Manitoba, Canada
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Average Formula - Include zeros

    I would like to post an example file but I keep on getting a DB error on the site

    Database error
    The Excel Help Forum database has encountered a problem.

    --------------------------------------------------------------------------------

    Please try the following:
    Load the page again by clicking the Refresh button in your web browser.
    Open the www.excelforum.com home page, then try to open another page.
    Click the Back button to try another link.

    The www.excelforum.com forum technical staff have been notified of the error, though you may contact them if the problem persists.

    We apologise for any inconvenience.

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

    Re: Average Formula - Include zeros

    Is it too big? Try zipping the file first.

  8. #8
    Registered User
    Join Date
    08-19-2009
    Location
    Winnipeg, Manitoba, Canada
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Average Formula - Include zeros

    Strange ... its not over the limit but zipping the file worked ...thank you
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-19-2009
    Location
    Winnipeg, Manitoba, Canada
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Average Formula - Include zeros

    Opps ...sorry but I forgot to mention that .....

    I'm trying to include this formula on the "KPI Analysis" Tab under Columns "DD" and DE" "YTD Averages"

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

    Re: Average Formula - Include zeros

    I tried Daddylonglegs' formula and it worked

    Did you remember to confirm it with CTRL+SHIFT+ENTER?

  11. #11
    Registered User
    Join Date
    08-19-2009
    Location
    Winnipeg, Manitoba, Canada
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Average Formula - Include zeros

    Hello,

    Yes I did .... and I still got the #Value!

    Did you try that formula in the WB that I posted?

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

    Re: Average Formula - Include zeros

    The formula needs to absolutely reference row 7:

    =IF(SUM(($D$7:$DC$7="Planned")*(D10:DC10))<>0,AVERAGE(IF(($D$7:$DC$7="Planned")*(D10:DC10),D10:DC10)),0)

    copied down after confirming with CSE

  13. #13
    Registered User
    Join Date
    08-19-2009
    Location
    Winnipeg, Manitoba, Canada
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: Average Formula - Include zeros

    Yup! .... that did it...thank you so much everyone!

+ 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