Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default What does "=--([Cell Reference])" do?

I've seen some posts referencing a spreadsheet function I've never seen
before. The function is two dashes "--" followed by a cell or range
reference. I've played with it a little bit, but can't find out exactly what
it is supposed to do, because it does different things in different places.
I'm not using it for anything, I just like to learn new things.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default What does "=--([Cell Reference])" do?

The double unary minus (--) converts TRUE and FALSE values to 1s and
0s respectively, so that they can be used in normal arithmetic. It can
also be used to convert numbers which are text values into proper
numbers.

Hope this helps.

Pete

On Sep 18, 4:10*pm, Ssverret
wrote:
I've seen some posts referencing a spreadsheet function I've never seen
before. *The function is two dashes "--" followed by a cell or range
reference. *I've played with it a little bit, but can't find out exactly what
it is supposed to do, because it does different things in different places. *
I'm not using it for anything, I just like to learn new things.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default What does "=--([Cell Reference])" do?

That is actual double negation. It is used to coerce non numbers into numbers
or to coerce true / false into 1 and 0.

You can do the same thing by multiplying by 1 or such but the nice part of
double negation is that it is an immediate clue that you need to coerce
something to a number as opposed to perform a mathematic operation to it.
--
HTH...

Jim Thomlinson


"Ssverret" wrote:

I've seen some posts referencing a spreadsheet function I've never seen
before. The function is two dashes "--" followed by a cell or range
reference. I've played with it a little bit, but can't find out exactly what
it is supposed to do, because it does different things in different places.
I'm not using it for anything, I just like to learn new things.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default What does "=--([Cell Reference])" do?



"Pete_UK" wrote:

The double unary minus (--) converts TRUE and FALSE values to 1s and
0s respectively, so that they can be used in normal arithmetic. It can
also be used to convert numbers which are text values into proper
numbers.

Hope this helps.

Pete

On Sep 18, 4:10 pm, Ssverret
wrote:
I've seen some posts referencing a spreadsheet function I've never seen
before. The function is two dashes "--" followed by a cell or range
reference. I've played with it a little bit, but can't find out exactly what
it is supposed to do, because it does different things in different places.
I'm not using it for anything, I just like to learn new things.


Thanks for your help Pete and Jim, I tried it a few times and it worked
perfectly. I had a previous method for turning text into numbers, but this
one is better. Steve
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
can lookup return cell reference istead of "text" for sumif? [email protected] Excel Worksheet Functions 1 April 26th 08 03:23 PM
Copying formulas using "+" cell reference causes r1c1 in linked sh Andy D Excel Discussion (Misc queries) 4 October 25th 07 05:11 PM
How do I reference a cell as PART of a vlookup "Table_Array" locat -Rocket Excel Worksheet Functions 2 January 4th 07 03:49 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM


All times are GMT +1. The time now is 03:49 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"