#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default "--" in formulas

What does "--" do when used in a formula?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 225
Default "--" in formulas

It
converts numbers stored as text back to numbers so that the formulas which
expect numbers as arguments can work...
converts TRUE and FALSE to 1 and 0...

It is basically two - together...
Applied on a TEXT/Boolean forces Excel to convert it to a number... so a
single - will also do the above but give you -5 for 5. By putting two - you
convert it back to 5 since -(-5) is 5.

"JoelS" wrote:

What does "--" do when used in a formula?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default "--" in formulas

J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

JoelS wrote:

What does "--" do when used in a formula?


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default "--" in formulas

It is generally used to convert either text or a boolean to an equivalent
number.
Put '42 into cell A1. =-A1 gives -42, =--A1 gives 42
Similarly FALSE is converted to zero, and TRUE to 1.
--
David Biddulph

"JoelS" wrote in message
...
What does "--" do when used in a formula?



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 418
Default "--" in formulas

"JoelS" wrote:
What does "--" do when used in a formula?


It is simply double negation. For example, if A1 contains 1, -A1 results in
-1, --A1 results in 1 because -(-1) is 1, and ---A1 is -1 again.

However, you will often see "--" used to convert boolean values (TRUE,
FALSE) to numeric values (1, 0). You can accomplish the same thing by
multiplying by 1 or adding zero. This is particularly useful in SUMPRODUCT
expressions.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Combine logical formulas "if", "and", "or" pscu Excel Discussion (Misc queries) 5 November 2nd 06 07:43 PM
Combining formulas, "and" & "or" to verify content of multiple cel Shu of AZ Excel Discussion (Misc queries) 15 October 15th 06 11:22 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 02:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"