+ Reply to Thread
Results 1 to 3 of 3

What does -- sign stands for?

Hybrid View

  1. #1
    Registered User
    Join Date
    03-24-2012
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    17

    What does -- sign stands for?

    Hi,

    Considering this formula:

    =SUMPRODUCT(--(B4:D4=0);--E4:G4;--H4:J4)
    What does -- sign stands for?

    Thanks in advance.

    Best regards.
    John

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,700

    Re: What does -- sign stands for?

    Hello John, a "test" like B4:D4=0 returns an "array" of TRUE/FALSE values, e.g.

    {TRUE,FALSE,TRUE}

    when you use -- in front of that it "co-erces" the FALSE values to zero and the TRUE values to 1 so you get

    {1,0,1}

    SUMPRODUCT can then use those numeric values

    You can use other "co-ercers" like +0 or *1

    Note: in your formula, with numbers in E4:J4 you don't need -- for those, i.e. this formula should work

    =SUMPRODUCT(--(B4:D4=0);E4:G4;H4:J4)
    Audere est facere

  3. #3
    Registered User
    Join Date
    03-24-2012
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: What does -- sign stands for?

    Hello,

    Yes, it works the other way too. Thank you for clarifying this out.

+ 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