+ Reply to Thread
Results 1 to 4 of 4

IF statement formula excluding cells with a 0

  1. #1
    Registered User
    Join Date
    05-29-2017
    Location
    Charleston, SC
    MS-Off Ver
    365
    Posts
    4

    IF statement formula excluding cells with a 0

    I have a formula built to provide a weighted average but in some cases there will be zeros in the range that I would like to exclude automatically. The current formula is =((B$5*C$15)+(B$6*C$16)+(B$7*C$17)+(B$8*C$18)+(B$9*C$19)+(B$10*C$20))/(C$15+C$16+C$17+C$18+C$19+C$20)

    The numbers in column B refer to the particular percentage (score) and the numbers in Column C refer to the weight given to a particular score.

    So, if B5 were to be 0 for some reason, and should not be included in the weighted average, the formula should be =((B$6*C$16)+(B$7*C$17)+(B$8*C$18)+(B$9*C$19)+(B$10*C$20))/(C$16+C$17+C$18+C$19+C$20) and so on if other cells have a 0.

    Thanks!

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,097

    Re: IF statement formula excluding cells with a 0

    how about:
    =SUMPRODUCT((B$5:B$10*C$15:C$20))/SUMIF(B$5:B$10,"<>0",C$15:C$20)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    05-29-2017
    Location
    Charleston, SC
    MS-Off Ver
    365
    Posts
    4

    Re: IF statement formula excluding cells with a 0

    Brilliant! Worked perfectly. Thanks a million!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2019 (Win 10 - Work) & 365 Subscription Insider (Win 10 - Home)
    Posts
    34,190

    Re: IF statement formula excluding cells with a 0

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

+ 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