+ Reply to Thread
Results 1 to 10 of 10

I want Sumproduct to not show 0 but -

Hybrid View

  1. #1
    Registered User
    Join Date
    02-09-2011
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    17

    I want Sumproduct to not show 0 but -

    Hello,

    I hope some one can help me with this tricky one.

    When i Use sumproduct formula i want it to show "-" or or nothing at all insted of 0. Is that possible. I have attached a excel sheet to show what i mean.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: I want Sumproduct to not show 0 but -

    I would strongly advise using a Custom Number Format to mask 0 with either hyphen or blank rather than double evaluating the SUMPRODUCT.

    I am assuming you're using SUMPRODUCT rather than SUMIF because you're data is stored in another file which might be closed

  3. #3
    Registered User
    Join Date
    02-09-2011
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: I want Sumproduct to not show 0 but -

    Thats correct I am using other workbooks that are closed. I did not understand the conditional formating. Could you pleas show?
    Last edited by DonkeyOte; 03-11-2011 at 08:47 AM. Reason: removed unnecessary quote

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: I want Sumproduct to not show 0 but -

    We're not talking about Conditional Formatting (altogether different [super volatile]) but rather Customising a Number Format.

    Instead of formatting your result cell as General, Number etc you assign a Customised Format - see here for a more graphic example

  5. #5
    Registered User
    Join Date
    02-09-2011
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: I want Sumproduct to not show 0 but -

    Ok I got it to work but the thing is that I am using a grapfh and the point of not showing 0 is to have the starting point of the graph not in 0 but the given number by the "sumproduct formula"
    Last edited by DonkeyOte; 03-11-2011 at 08:46 AM. Reason: removed unnecessary quote

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: I want Sumproduct to not show 0 but -

    OK - might have been worth mentioning that a little earlier

    What you could do is use something like:

    =LOOKUP(9.99E+307;CHOOSE({1\2};"";1/(1/SUMPRODUCT(....))))
    What will then happen is 0's will become #N/A and won't plot - obviously you need to revise the SUMPRODUCT element per your own formula.

  7. #7
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: I want Sumproduct to not show 0 but -

    this type of construct should work

    =IF(OR(ISERROR('SUMPRODUCT(($F$28:$F$32=!$B$1)*1;($C$28:$C$32))),'SUMPRODUCT(($F$28:$F$32=!$B$1)*1;($C$28:$C$32))=0),"-",'SUMPRODUCT(($F$28:$F$32=!$B$1)*1;($C$28:$C$32)))
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: I want Sumproduct to not show 0 but -

    @scottylad2, the point here is that avoiding double evaluation (triple in the above) is something of a no-brainer where SUMPRODUCTs are involved

    FWIW, there's simply no need to evaluate the SUMPRODUCT three times.

    Should you want to persist with repeat calculations I would advise you divide 1 by the SUMPRODUCT result and test for numeric result.

    The above is based on the fact that an error or SUMPRODUCT result of 0 would generate an Error, in UK syntax terms:

    =IF(ISERROR(1/SUMPRODUCT(...)),NA(),SUMPRODUCT(...))
    But again to reiterate I would suggest avoiding the double evaluation altogether and use an alternative construct:

    =LOOKUP(9.99E+307,CHOOSE({1,2},"",1/(1/SUMPRODUCT(...))))
    which would also generate either Number or #N/A error whilst evaluating the SUMPRODUCT once only

    Note use of NA is for sake of chart plot - hyphen/null string etc would behave no differently to 0 in that regard.
    Last edited by DonkeyOte; 03-11-2011 at 11:03 AM. Reason: change ISERR to ISERROR

+ 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