+ Reply to Thread
Results 1 to 4 of 4

what is the purpose for "--" in the SumProduct(-- or Max(-- formula

  1. #1
    Registered User
    Join Date
    08-23-2013
    Location
    Louisville, KY
    MS-Off Ver
    Excel 2007
    Posts
    2

    what is the purpose for "--" in the SumProduct(-- or Max(-- formula

    I have a formula
    =SUMPRODUCT(MAX(--($O$3:$O$366=O366)*$M$3:$M$366))
    This works great but I do not know what the -- does?

    Also is there a way to use Name Ranges instead of cell ranges
    Range Name CalYr2014 is O3:O366

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,843

    Re: what is the purpose for "--" in the SumProduct(-- or Max(-- formula

    To convert TRUE or FALSE to 1 and 0. Sumproduct can't sum a bunch of TRUE's but it can sum a bunch of 1's.
    Excel recognizes that you try to perform a numerical calculation on TRUE or FALSE ( the -- operation) and converts it to 1 and 0.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,843

    Re: what is the purpose for "--" in the SumProduct(-- or Max(-- formula

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    Re: what is the purpose for "--" in the SumProduct(-- or Max(-- formula

    In this particular case -- is unnecessary because the multiplication using * implicitly converts TRUE to 1 and FALSE to zero anyway, so you only need this version

    =SUMPRODUCT(MAX(($O$3:$O$366=O366)*$M$3:$M$366))
    Audere est facere

+ 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: 1
    Last Post: 02-28-2012, 02:55 AM
  2. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  3. what is the purpose of "run dialog" in excel 2007?
    By hariprof in forum Excel General
    Replies: 2
    Last Post: 02-25-2010, 05:05 AM
  4. Purpose of the "If Not Intersect" statement
    By ExcelQuestion in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2008, 02:22 PM
  5. If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ...
    By Maria J-son in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2006, 08:25 AM

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