Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Weighted Average With Exclusions (Office 2003)

    I need to calculate a weighted average of thousands of records. My current formula is:

    =SUMPRODUCT(Details!N2etails!N10959,Details!K2etails!K10959)/SUM(Details!K2etails!K10959)

    This works great, except I want to EXCLUDE all rows where the value in the N column is a 0. There may be amounts in the K column, but I don't want them included as they will reduce the weighted average.

    Any suggestions?

    Thank you!

    Nancy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Weighted Average With Exclusions (Office 2003)

    Try

    =SUMPRODUCT(Details!N2:N10959,Details!K2:K10959)/SUMIF(Details!N2:N10959,">0",Details!K2:K10959)

    This assumes that the values are positive or zero. If they can be negative too, use "<>0" instead of ">0"

  3. #3
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Weighted Average With Exclusions (Office 2003)

    Great, thanks, Hans.

    I was trying to get it on the left side and it wasn't working at all.

    Nancy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •