ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Double Negative in formulas (https://www.excelbanter.com/excel-discussion-misc-queries/202269-double-negative-formulas.html)

Rick

Double Negative in formulas
 
I have recently been introduced to the double negative '--' in formulas.

Can someone explain this to me as to why it works over just anormal positive
value.

Thanks
Rick

smartin

Double Negative in formulas
 
Rick wrote:
I have recently been introduced to the double negative '--' in formulas.

Can someone explain this to me as to why it works over just anormal positive
value.

Thanks


Hi Rick,

This site gives a concise answer:

http://www.mcgimpsey.com/excel/formulae/doubleneg.html

You will also find the "--" construction referred to as "double unary
minus".

David Biddulph[_2_]

Double Negative in formulas
 
To answer the OP's specific question as to why the double unary minus works
and a unary plus doesn't, try putting TRUE in A1 and FALSE in A2, then use
the formulae =-A1 in B1, =-B1 in C1, and =+A1 in D1. Copy these down to row
2 as well. You'll see that =+A1 is (not surprisingly) treated just as =A1,
so the results remain as TRUE and FALSE. A unary negative changes the
values, whereas a unary positive doesn't.
--
David Biddulph

"smartin" wrote in message
...
Rick wrote:
I have recently been introduced to the double negative '--' in formulas.

Can someone explain this to me as to why it works over just anormal
positive value.

Thanks


Hi Rick,

This site gives a concise answer:

http://www.mcgimpsey.com/excel/formulae/doubleneg.html

You will also find the "--" construction referred to as "double unary
minus".





All times are GMT +1. The time now is 05:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com