+ Reply to Thread
Results 1 to 8 of 8

Including 0 in formula (#DIV/0!)

  1. #1
    Registered User
    Join Date
    01-31-2010
    Location
    Perth
    MS-Off Ver
    Excel 2007
    Posts
    9

    Including 0 in formula (#DIV/0!)

    Hi all,

    I am trying to create a marksbook that will ignore blank cells and calculate a percentage based on the amount of tasks completed.
    So far I have managed to get it all working EXCEPT if I enter 0 as a value.

    For example, suppose there are two tasks, both of equal value. If a person was to get 100% for the first task, and 0 for the second task, you would expect the total to be 50%. I cannot get my formula to recognise that a 0 has been entered. Can anyone please help?

    (Cells F5:T5 are what the task is out of. Cells F6:T6 is the weighting. I want to be able to enter a 0 in cells F8:T8 to include it in the final percentage.)

    CODE:

    =IF(AND(ISBLANK(F8),ISBLANK(G8),ISBLANK(H8),ISBLANK(I8),ISBLANK(J8),ISBLANK(K8),ISBLANK(L8),ISBLANK(M8),ISBLANK(N8),ISBLANK(O8),ISBLANK(P8),ISBLANK(Q8),ISBLANK(R8),ISBLANK(S8),ISBLANK(T8)),"",(SUM((IF(LEN(TRIM(F8))=0,,SUM((F8/$F$5)*$F$6/100))+IF(LEN(TRIM(G8))=0,,SUM((G8/$G$5)*$G$6/100))+IF(LEN(TRIM(H8))=0,,SUM((H8/$H$5)*$H$6/100))+IF(LEN(TRIM(I8))=0,,SUM((I8/$I$5)*$I$6/100))+IF(LEN(TRIM(J8))=0,,IFSUM((J8/$J$5)*$J$6/100))+IF(LEN(TRIM(K8))=0,,SUM((K8/$K$5)*$K$6/100))+IF(LEN(TRIM(L8))=0,,SUM((L8/$L$5)*$L$6/100))+IF(LEN(TRIM(M8))=0,,SUM((M8/$M$5)*$M$6/100))+IF(LEN(TRIM(N8))=0,,SUM((N8/$N$5)*$N$6/100))+IF(LEN(TRIM(O8))=0,,SUM((O8/$O$5)*$O$6/100))+IF(LEN(TRIM(P8))=0,,SUM((P8/$P$5)*$P$6/100))+IF(LEN(TRIM(Q8))=0,,SUM((Q8/$Q$5)*$Q$6/100))+IF(LEN(TRIM(R8))=0,,SUM((R8/$R$5)*$R$6/100))+IF(LEN(TRIM(S8))=0,,SUM((S8/$S$5)*$S$6/100))+IF(LEN(TRIM(T8))=0,,SUM((T8/$T$5)*$T$6/100)))*100/(SUMIF(F8:T8,">0",$F$6:$T$6)))))

    Link for excel doc --> http://www.4shared.com/file/21197544...ARKSBook1.html
    Last edited by UMOP; 01-31-2010 at 03:06 AM. Reason: Added link

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Including 0 in formula (#DIV/0!)

    Hi UMOP
    can you attach a zipped workbook?
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    01-31-2010
    Location
    Perth
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Including 0 in formula (#DIV/0!)

    Yep. Done. Thanks for any help you can provide Pike.
    Attached Files Attached Files
    Last edited by teylyn; 01-31-2010 at 04:14 AM. Reason: quote deleted

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Including 0 in formula (#DIV/0!)

    UMOP,

    please don't quote whole posts. It's just clutter. In fact, only quote when you are referring to something particular that is not in the previous post, and then only quote the pertinent lines.

    Thank you.

  5. #5
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Including 0 in formula (#DIV/0!)

    Hi UMOP
    try .. in U9
    Please Login or Register  to view this content.
    Last edited by pike; 01-31-2010 at 05:52 AM. Reason: add $

  6. #6
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Including 0 in formula (#DIV/0!)

    95% reduction in formula length... that is hot

  7. #7
    Registered User
    Join Date
    01-31-2010
    Location
    Perth
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Including 0 in formula (#DIV/0!)

    Thank you for all your help, I have solved my problem with it not accepting a 0 as an input.

    Cheers to you all.

  8. #8
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Including 0 in formula (#DIV/0!)

    did you try the formula ? it does it all
    Attached Files Attached Files
    Last edited by pike; 01-31-2010 at 08:18 AM.

+ 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