+ Reply to Thread
Results 1 to 4 of 4

Double unary operator

  1. #1
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Double unary operator

    Dear Community, Good morning.

    I am seeking clarification over something which I have read this morning.

    Is --( a replacement for * when formatting a sumproduct calculation?

    ie, is:

    =sumproduct((array1=condition1)*(array2=condition2)*(array3))

    the same as

    =sumproduct(--(array1=condition1),--(array2=condition2),(array3))

    Thanks v much
    Last edited by Blake 7; 11-03-2010 at 05:43 AM.
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Double unary operator

    In most instances it is a replacement, but there are some cases where it differs. See http://www.xldynamic.com/source/xld.SUMPRODUCT.html

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

    Re: Double unary operator

    Yes - though the outer parentheses re: array 3 are not required in either example.

    Both approaches have their advantages over the other... for ex:

    Double unary is regarded as being slightly quicker
    (though if you're worried about efficiency then you shouldn't be using SUMPRODUCT)

    Double unary also allows for non-numerics in array3 (the * does not given explicit coercion)

    Multiplication allows for arrays with differing dimensions (double unary does not)

    Double Unary is open to error with direct volatile precedents in XL2007 depending on updates installed on client
    Last edited by DonkeyOte; 11-03-2010 at 05:50 AM. Reason: clarified: either

  4. #4
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Double unary operator

    Thanks Gents for the clarification.

    The link you posted Bob was the one which I was reading, but by the time I got to the format section my brain was fried.

    Have a good day.

+ 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