+ Reply to Thread
Results 1 to 3 of 3

Calculating "Weighted Average" but excluding certain items

  1. #1
    Registered User
    Join Date
    02-24-2012
    Location
    Richboro, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Calculating "Weighted Average" but excluding certain items

    =(SUMIF($G8:$G35,"f",$R8:$R35))/(SUMIF($G8:$G35,"f",$I8:$I35))

    The above formula works fine. However, the R cell I am referring to is a reference to another cell that really is another calculation (we will call the calculation in that cell "I x M".) Is there anyway to get this whole calculation in the above formula within the need for column R? What I mean is make the "$R8:$R35 " in the above formula something like "(SUMPRODUCT(I8:I39,M8:M39) "? When I try to do that I get an error which logically I understand. However I cannot figure out how I can do this without a whole new column.

    My goal is calculating a weighted average function in one formula using only three columns: "G" which is the SUMIF condition field (I only want to calculate items that say F in that field) , and "I" and "M" which are what I need to calculate the weighted average.

    Thanks,

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

    Re: Calculating "Weighted Average" but excluding certain items

    Hello Jasonwwall, try this version

    =SUMPRODUCT(($G8:$G35="f")+0,I8:I35,M8:M35)/SUMIF($G8:$G35,"f",$I8:$I35)
    Audere est facere

  3. #3
    Registered User
    Join Date
    02-24-2012
    Location
    Richboro, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Calculating "Weighted Average" but excluding certain items

    Works great!!! Thank you, I didn't know the SUMPRODUCT command had that kind of flexibility but I knew there was a simpler way of calculating this.

+ 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