+ Reply to Thread
Results 1 to 7 of 7

What does -- mean in an excel formula?

  1. #1
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    What does -- mean in an excel formula?

    I understand -- is a shorthand but what does -- mean in an excel formula?
    Click on star (*) below if this helps

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: What does -- mean in an excel formula?

    It coerces TRUE and FALSE to the numbers 1 and 0 respectively. Often used in an array formula, or a formula using a function like SUMPRODUCT which acts on an array, to convert a series of TRUEs and FALSEs to 1s and 0s which can then be added (or multiplied). It's also another way of writing *1 (though it is the same number of characters, so it can't be considered as a shorthand version) to force a text representation of a numeric value (or date) into that numeric value - essentially, multiplying by -1 and then by -1 again.

    Do you have a particular formula in mind?

    Hope this helps.

    Pete
    Last edited by Pete_UK; 09-04-2012 at 01:54 PM.

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: What does -- mean in an excel formula?

    Hi KM,

    First hyphen sign converts the TRUEs in the formula to -1 and second hyphen sign coverts them to +1 or (1)... which then can be summed up to produce the result. remember BODMAS rule which we studied in school.. minus multiplied by minus equals to plus (positive)
    It would be better if you share the formula where you have noticed this so that I can explain you in that context.. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: What does -- mean in an excel formula?

    Here is a good resource worth bookmarking...

    http://xldynamic.com/source/xld.SUMPRODUCT.html
    HTH
    Regards, Jeff

  5. #5
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: What does -- mean in an excel formula?

    Thank you. I appreciated the explanation. I understand that it converts TRUE and FALSE to zeros and ones and text to numbers. I didn't realize this

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: What does -- mean in an excel formula?

    Great..!!

    Also you can relate that in vlookup either we can write false or true as last part of the syntax.. and some people used to write 0 and 1 instead of False and True respectively.. this suggests that excel treats False = 0 and True =1 (or any value greater than zero )

    So basis this, TRUEs are 1 and FALSEs are 0
    But if your compare 1 with True and 0 with false, they are not equal (Try typing 1 in A1 and True in A2 and formula "=a1=a2" in A3, you'll get False


    This is my understanding and experience based research, may be experts can share more knowledge on this.. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: What does -- mean in an excel formula?

    Quote Originally Posted by dilipandey View Post
    excel treats False = 0 and True =1 (or any value greater than zero )
    the value does not have to be greater than 0-any value other than 0 is converted to TRUE
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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