+ Reply to Thread
Results 1 to 4 of 4

why should "--" be used in SUMPRODUCT formula

  1. #1
    Registered User
    Join Date
    07-14-2008
    Location
    INDIA
    Posts
    78

    why should "--" be used in SUMPRODUCT formula

    Hi,

    I have not used this SUMPRODUCT function very much and now I am trying to learn this. But I could not understand why "--" should be used as in a formula

    =SUMPRODUCT(--(A2:A6="Active"), --(B2:B6>=10),--(C2:C6))
    Is it a compulsion.?.

    Can someone explain me the advantages and disadvantages of "--".

    Thank you.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: why should "--" be used in SUMPRODUCT formula

    you can use 1* or 0+ instead of -- and you'll get same result.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: why should "--" be used in SUMPRODUCT formula

    Have a read through this article:

    Sumproduct
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

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

    Re: why should "--" be used in SUMPRODUCT formula

    It used to coerce Booleans (True/False) to their integer equivalents (1/0 respectively). As zbor has implied you can coerce Booleans using a variety of operators, the double unary method (--) is regarded the most efficient.

    For more info. on Sumproduct I would suggest reading through Bob Phillips' (MS Excel MVP) white paper on the subject - see the SUMPRODUCT link in my signature.

+ 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