ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Purpose of Double Unary in AND Statement (https://www.excelbanter.com/excel-worksheet-functions/208310-purpose-double-unary-statement.html)

Daren

Purpose of Double Unary in AND Statement
 
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2).

What's the purpose of the double unary here?

Thanks!

[email protected]

Purpose of Double Unary in AND Statement
 
Daren
The -- can be used to cause Excel to convert strings that look like
numbers to numbers; which will allow the numeric calculations to
work. It serves the same purpose as the N() function.
That would be my guess.
Ken

On Oct 29, 5:11*pm, Daren wrote:
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2). *

What's the purpose of the double unary here?

Thanks!



T. Valko

Purpose of Double Unary in AND Statement
 
It could be because the referenced cells contain TEXT numbers. The "--" will
coerce TEXT numbers to NUMERIC numbers.


--
Biff
Microsoft Excel MVP


"Daren" wrote in message
...
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2).

What's the purpose of the double unary here?

Thanks!




Bernard Liengme

Purpose of Double Unary in AND Statement
 
When Excel is asked to do an arithmetic operation ( add, multiply, etc)
Boolean values (True or False), it treats TRUE as 1 and False as 0. The
double negation (please note that ++ is also double unary) is one such
arithmetic operation.
It does the same thing if the cell has text that can be represented as a
number.
But it is not clear what the purpose is in the example. Can you tell us what
is in the cells?
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Daren" wrote in message
...
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2).

What's the purpose of the double unary here?

Thanks!




David Biddulph[_2_]

Purpose of Double Unary in AND Statement
 
If A2:B2 contain text which looks like dates, the double unary minus will
convert them to real dates.
Note also that your formula has an m that ought to be a comma.
Note also that "double unary" by itself isn't a very specific term:
-- is a double unary minus
++ would be a double unary plus.
--
David Biddulph

"Daren" wrote in message
...
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2).

What's the purpose of the double unary here?

Thanks!




Bernard Liengme

Purpose of Double Unary in AND Statement
 
David,
Can I be a nit-picker?

In (4 - 2) we are have 4 minus 2 (or 4 subtract 2) but in -4 we are not
doing any subtraction, rather we are negating 4 (in -x this amounts to
changing the sign of x)
So I like to use the term "double negation" or "double unary negation" but
since negation is a unary op the middle word is redundant

Sorry, but in retirement I must be missing my students to pick on !!!
best wishes from Canada
--
Bernard

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
If A2:B2 contain text which looks like dates, the double unary minus will
convert them to real dates.
Note also that your formula has an m that ought to be a comma.
Note also that "double unary" by itself isn't a very specific term:
-- is a double unary minus
++ would be a double unary plus.
--
David Biddulph

"Daren" wrote in message
...
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2).

What's the purpose of the double unary here?

Thanks!






Daren

Purpose of Double Unary in AND Statement
 
Those cells have dates in them. They're supposed to be formatted as
3/14/2001 but sometimes they have an extra slash in them, so I change them
with find/replace to format as 3/14/2001

"Bernard Liengme" wrote:

When Excel is asked to do an arithmetic operation ( add, multiply, etc)
Boolean values (True or False), it treats TRUE as 1 and False as 0. The
double negation (please note that ++ is also double unary) is one such
arithmetic operation.
It does the same thing if the cell has text that can be represented as a
number.
But it is not clear what the purpose is in the example. Can you tell us what
is in the cells?
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Daren" wrote in message
...
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2).

What's the purpose of the double unary here?

Thanks!





Daren

Purpose of Double Unary in AND Statement
 
Thanks.

"Bernard Liengme" wrote:

When Excel is asked to do an arithmetic operation ( add, multiply, etc)
Boolean values (True or False), it treats TRUE as 1 and False as 0. The
double negation (please note that ++ is also double unary) is one such
arithmetic operation.
It does the same thing if the cell has text that can be represented as a
number.
But it is not clear what the purpose is in the example. Can you tell us what
is in the cells?
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Daren" wrote in message
...
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2).

What's the purpose of the double unary here?

Thanks!





Daren

Purpose of Double Unary in AND Statement
 
Thanks!


" wrote:

Daren
The -- can be used to cause Excel to convert strings that look like
numbers to numbers; which will allow the numeric calculations to
work. It serves the same purpose as the N() function.
That would be my guess.
Ken

On Oct 29, 5:11 pm, Daren wrote:
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2).

What's the purpose of the double unary here?

Thanks!




Daren

Purpose of Double Unary in AND Statement
 
Thanks!

"T. Valko" wrote:

It could be because the referenced cells contain TEXT numbers. The "--" will
coerce TEXT numbers to NUMERIC numbers.


--
Biff
Microsoft Excel MVP


"Daren" wrote in message
...
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2).

What's the purpose of the double unary here?

Thanks!





Daren

Purpose of Double Unary in AND Statement
 
Thanks.

"David Biddulph" wrote:

If A2:B2 contain text which looks like dates, the double unary minus will
convert them to real dates.
Note also that your formula has an m that ought to be a comma.
Note also that "double unary" by itself isn't a very specific term:
-- is a double unary minus
++ would be a double unary plus.
--
David Biddulph

"Daren" wrote in message
...
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2).

What's the purpose of the double unary here?

Thanks!





T. Valko

Purpose of Double Unary in AND Statement
 
You're welcome!

--
Biff
Microsoft Excel MVP


"Daren" wrote in message
...
Thanks!

"T. Valko" wrote:

It could be because the referenced cells contain TEXT numbers. The "--"
will
coerce TEXT numbers to NUMERIC numbers.


--
Biff
Microsoft Excel MVP


"Daren" wrote in message
...
Hello,

The AND statement is as follows:

=and(--d2--c2,--c2--b2m--b2--a2).

What's the purpose of the double unary here?

Thanks!








All times are GMT +1. The time now is 09:42 AM.

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