double negatives

Wishmaster89

Board Regular
Joined
Jan 10, 2022
Messages
77
Office Version
  1. 2021
  2. 2019
  3. 2016
Platform
  1. Windows
  2. MacOS
Hi

Just curious about using -- on text values. I know this converts a value to a number but i can't find anything on google about how this works. All i can find is that it turns the values into true/false.

Anyone know what -- does in order to convert to number please?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Excel automatically coerces TRUE/FALSE to 1/0 with any math operation (you'll see +0 and *1 used as well as --).
As far as Double Negation (Double Unary) goes the first negative changes TRUE values to -1 and FALSE values to 0.
The second negative simply changes the -1 to 1
 
Upvote 0
Excel automatically coerces TRUE/FALSE to 1/0 with any math operation (you'll see +0 and *1 used as well as --).
As far as Double Negation (Double Unary) goes the first negative changes TRUE values to -1 and FALSE values to 0.
The second negative simply changes the -1 to 1

Ok thanks, would you reccomend this method for converting text values into numbers or is there a better method?
 
Upvote 0
Ok thanks, would you reccomend this method for converting text values into numbers or is there a better method?
I don't understand what you mean by "converting text values into numbers", Negation in itself just converts TRUE and FALSE to 1 and 0.
Sometimes a math operation will convert a number stored as text to real number and some Excel functions automatically treat a number stored as text as a real number.
If you do mean converting a number stored as text, then I personally prefer using Text to Columns to correct the original data in place
 
Upvote 0
I don't understand what you mean by "converting text values into numbers", Negation in itself just converts TRUE and FALSE to 1 and 0.
Sometimes a math operation will convert a number stored as text to real number and some Excel functions automatically treat a number stored as text as a real number.
If you do mean converting a number stored as text, then I personally prefer using Text to Columns to correct the original data in place
Yea i mean converting to a number stored as text. For example i needed to remove the / from “20/21” so i found something on google that said use =- - substitute. I’ve tested this and isnumber returns true after using that formula( before using that formula it was false)
 
Upvote 0

Forum statistics

Threads
1,213,550
Messages
6,114,265
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top