+ Reply to Thread
Results 1 to 4 of 4

sumproduct question - kind of...

  1. #1
    Poody
    Guest

    sumproduct question - kind of...

    I needed a formula (that I was able to find on this group, btw). The formula
    from the gropu was:

    =sumproduct(--(B2:B10=1),--(F2:F10="Completed"))

    My question is, what does the -- do, and can I find more information about
    this in the help files? If it is in help, what is it called, as I haven't
    been able to find anything about it - even when looking at the sumproduct
    help information.

    Thanks,

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    -- is known as double unary minus, its function in a formula like

    =sumproduct(--(B2:B10=1),--(F2:F10="Completed"))

    is to convert an array of TRUE/FALSE values to 1/0, e.g.

    (B2:B10=1) returns an array like

    {TRUE,FALSE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE,TRUE}

    -- coerces this to

    {1,0,1,1,0,0,1,1,1}

    the same happens with

    --(F2:F10="Completed")

    SUMPRODUCT then multiplies the two arrays (giving 1 only when both arrays are 1) and then sums the resultant single array thereby effectively counting the rows where both conditions are true. The arrays can be co-erced in other ways, e.g. by adding zero or multiplying by 1, so you could as easily use

    =sumproduct((B2:B10=1)+0,(F2:F10="Completed")*1)

  3. #3
    Bob Phillips
    Guest

    Re: sumproduct question - kind of...

    See http://www.xldynamic.com/source/xld.SUMPRODUCT.html for a detailed
    explanation. It isn't in help.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Poody" <[email protected]> wrote in message
    news:[email protected]...
    > I needed a formula (that I was able to find on this group, btw). The

    formula
    > from the gropu was:
    >
    > =sumproduct(--(B2:B10=1),--(F2:F10="Completed"))
    >
    > My question is, what does the -- do, and can I find more information about
    > this in the help files? If it is in help, what is it called, as I haven't
    > been able to find anything about it - even when looking at the sumproduct
    > help information.
    >
    > Thanks,




  4. #4
    Poody
    Guest

    Re: sumproduct question - kind of...

    Thank you both very much - that is great information.

    Rich

    "Bob Phillips" wrote:

    > See http://www.xldynamic.com/source/xld.SUMPRODUCT.html for a detailed
    > explanation. It isn't in help.
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "Poody" <[email protected]> wrote in message
    > news:[email protected]...
    > > I needed a formula (that I was able to find on this group, btw). The

    > formula
    > > from the gropu was:
    > >
    > > =sumproduct(--(B2:B10=1),--(F2:F10="Completed"))
    > >
    > > My question is, what does the -- do, and can I find more information about
    > > this in the help files? If it is in help, what is it called, as I haven't
    > > been able to find anything about it - even when looking at the sumproduct
    > > help information.
    > >
    > > Thanks,

    >
    >
    >


+ 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