+ Reply to Thread
Results 1 to 5 of 5

Average a set of numbers any removing all zeros from calculation

Hybrid View

  1. #1
    Registered User
    Join Date
    08-24-2012
    Location
    basel
    MS-Off Ver
    Excel 2003
    Posts
    23

    Average a set of numbers any removing all zeros from calculation

    Hi there,

    I want to average a set of numbers (column B) on the condition that it belongs to a certain value i.e 1 (column A). However, i want to remove all 0 (Zero) values in column B from the calculation. Does such a formula exist?

    A B
    1 0
    2 11
    1 15
    1 0
    2 6
    2 9
    1 15
    2 0

    I need to apply the formula to a spreadshee with circa 20,000 rows of information.

    Thanks in advance for any assistance.

    Adam

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Average a set of numbers any removing all zeros from calculation

    Use pivot table.

    See the example.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Average a set of numbers any removing all zeros from calculation

    =SUMPRODUCT((A1:A8=1)*(B1:B8<>0),B1:B8)/SUMPRODUCT((A1:A8=1)*(B1:B8<>0))
    where A1:B8 contains your range of data

    If you are using Excel 2007 or later version you could also use
    =AVERAGEIFS(B1:B8,A1:A8,1,B1:B8,"<>"&0)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    08-24-2012
    Location
    basel
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Average a set of numbers any removing all zeros from calculation

    Thanks very much Ace_XL and Oeldere

    It works.

    I appreciate it.

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Average a set of numbers any removing all zeros from calculation

    @ helpbitte

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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