+ Reply to Thread
Results 1 to 5 of 5

Conditional weighted average ignoring #N/A values

  1. #1
    Registered User
    Join Date
    05-31-2011
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    3

    Conditional weighted average ignoring #N/A values

    Hello,

    First post, so please direct me elsewhere if need be. I want to calculate the weighted average of the one column (i.e., Accuracy in the attachment) with the another column (i.e., Sample Size) column functioning as the weight. Normally this equation would work:

    =sumproduct(B2:B11,C2:C11)/SUM(C2:C11)
    BUT I'd also like to only calculate the weighted average based on whether the Skilled column is "Yes" or "No". Normally I could get by with this equation:

    =sumproduct(B2:B11,C2:C11,(D2:D11="Yes")+0)/sumproduct(C2:C11,(D2:D11="Yes")+0)
    Or an array formula:

    {=sum((B2:B11)*(C2:C11)*(D2:D11="Yes"))/sum(C2:C11*(D2:D11="Yes"))}
    However, neither of those work in the presence of the #N/A values, as found in the attachment or the image. Unfortunately, that data is to be dynamically populated and I can't guarantee that there won't be those #N/A values present when this worksheet is used. I've tried adding additional conditional parameters to account for it, but I haven't been able to get it to work. I can't get it to work even ignoring the "Skilled" conditional altogether.

    Does anyone have any thoughts? I'm afraid I have nobody at work to turn to.

    Thanks very much for the help.

    Greenshot_2012-02-21_22-16-12.png

  2. #2
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: Help with a conditional weighted average while ignoring #N/A values

    Are you allowed to replace your #N/A with just N/A?
    -Greg If this is helpful, pls click Star icon in lower left corner

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Help with a conditional weighted average while ignoring #N/A values

    Hi Syoung27,

    Try using array functionality to avoid #N/A, see the attached file - green cell. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Registered User
    Join Date
    05-31-2011
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Help with a conditional weighted average while ignoring #N/A values

    Thanks dilipandey! That did the trick right away. I actually didn't know you could combine mathematical calculations with array formulas, so you've taught me a few things today! And I added to your rep.

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Help with a conditional weighted average while ignoring #N/A values

    You are welcome syoung27 . . .

    Cheers

    Regards,
    DILIPandey

    <click on below star if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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