The '" -- " before a function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the name of this symbol and what is it do when placed in front of a
function name. ie. --isnumber........

Thanks
 
When you use a Boolean formula (a formula that returns TRUE or FALSE), Excel
returns those values. If the formula returns "numeric text", Excel will
treat it AS text. To coerce the conversion from Boolean to Numeric, or from
"numeric text" to Numeric, you need to apply an arithmetic operator. The
generally accepted convention is to use a double minus sign (--).

It works this way:
The negative of a value reverses the sign.
The negative of that value restores the sign.

Example:
RIGHT("W1000",4) returns with the *word* "1000"
-RIGHT("W1000",4) converts "1000" to the number -1000
--RIGHT("W1000",4) converts the negative number to 1000

In the case of boolean values, the dbl-neg converts TRUE and FALSE to 1 and
0, respectively.

You could achieve the same results by multiplying a value by 1, but the
dbl-neg indicates to knowledgable users that a "type conversion" is being
effected.

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
Ron,

Thanks for the great explanation. It makes alot of sense.

Comicfly
 
Biff,

Thanks for the guidelines / direction on the suggested websites.

Comicfly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top