+ Reply to Thread
Results 1 to 7 of 7

"--" used in sumproduct function

  1. #1
    Registered User
    Join Date
    04-17-2014
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Post "--" used in sumproduct function

    Can someone explain to me what "--". I cannot find a description for this

    INDEX(--(B1:B20>=100)

    Thank you in advance

  2. #2
    Registered User
    Join Date
    09-05-2012
    Location
    NZ
    MS-Off Ver
    2010
    Posts
    7

    Re: "--" used in sumproduct function

    Could be something missing here. As it stands this formula would not return a result. There are missing brackets and the syntax is incorrect for an INDEX formula.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: "--" used in sumproduct function

    Agreed, there seems to be something missing.....but this part

    B1:B20>=100

    will return an "array" of TRUE or FALSE values, one each for all values in B1:B20.

    When you add -- like this

    --(B1:B20>=100)

    then that "co-erces" TRUE to 1 and FALSE to zero so you get an array of 20 1/0 values, you could do the same by adding zero like this

    (B1:B20>=100)+0

    or multiplying by 1 like this

    (B1:B20>=100)*1

    although if you just want to count the number of values in B1:B20 that are >=100 you don't need any of those, you can use COUNTIF like

    =COUNTIF(B1:B20,">=100")
    Audere est facere

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    04-17-2014
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: "--" used in sumproduct function

    So sorry, meant to post a different function but i was leaving work and rushing a little...I saw it in another thread when i was working through a sum product issue and "--" was used.

    =SUMPRODUCT(--(C4:C8="RENEW"),--(D4:D8="John"),(J4:J8))

    I never really used sumproduct so when I saw "--" , I wasnt sure what its purpose was

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: "--" used in sumproduct function

    SUMPRODUCT is an extremely versatile function.

    Read through the xldynamic link in my other reply for some examples of how it can be used.

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: "--" used in sumproduct function

    To know, how the double negative works in Sumproduct, see the attached sheet where a simple Sumproduct formula is used, showing all the steps involved.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  2. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  3. SUMPRODUCT(--ISNUMBER(FIND("AM",C5:160))*(k5:k160="")
    By redneck joe in forum Excel General
    Replies: 5
    Last Post: 08-18-2006, 03:31 PM
  4. [SOLVED] Please add a "sheet" function like "row" and "column" functions
    By Spreadsheet Monkey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2005, 12:15 PM
  5. [SOLVED] Replace "insert function" with "edit formula" button in fourmula b
    By 13brian in forum Excel General
    Replies: 0
    Last Post: 08-24-2005, 04:05 PM

Tags for this Thread

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