+ 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,147

    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
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,365

    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!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Formula to count cells that are not empty excluding cells with formulas
    By Imbizile in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-20-2015, 07:08 AM
  2. Excluding cells from formula
    By Nico Zottos in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-17-2014, 12:15 PM
  3. Formula needed for dividing 2 sets of cells and excluding adjacent text cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-07-2013, 06:45 PM
  4. [SOLVED] If statement excluding cells with non-numeric values
    By tylerf in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-07-2013, 10:57 AM
  5. Excluding Cells from Standard Deviation Formula
    By Raistlin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-17-2012, 06:08 PM
  6. Formula Excluding Hidden Cells
    By Watson in forum Excel General
    Replies: 7
    Last Post: 04-13-2010, 06:26 AM
  7. Average Formula Excluding Empty Cells
    By Alhazred in forum Excel General
    Replies: 5
    Last Post: 03-21-2008, 08:31 AM

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