Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
"--" in formulas
What does "--" do when used in a formula?
|
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
"--" 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
Posted to microsoft.public.excel.misc
|
|||
|
|||
"--" 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
Posted to microsoft.public.excel.misc
|
|||
|
|||
"--" 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
Posted to microsoft.public.excel.misc
|
|||
|
|||
"--" 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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Combine logical formulas "if", "and", "or" | Excel Discussion (Misc queries) | |||
Combining formulas, "and" & "or" to verify content of multiple cel | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |