Excel BUG!

A

Asto

Dears,
let me say that something is going wrong:

- put in cell A1 the number 1
- type in another cell =A1^2 --> the results it's 1. well...
- type in another cell = - A1^2 --> the results it's 1 again!
- try with = 0 - A1^2 --> the results it's -1 ! hahaha
- =exp( - A1^2) --> the results it's 2.718281828!
wonderful

the bug is the same in 2003-2007-2010 versions.
Best wishes

Asto
 
I

Ian Riches

(e-mail address removed)>, (e-mail address removed)
says...
Dears,
let me say that something is going wrong:

- put in cell A1 the number 1
- type in another cell =A1^2 --> the results it's 1. well...
- type in another cell = - A1^2 --> the results it's 1 again!
- try with = 0 - A1^2 --> the results it's -1 ! hahaha
- =exp( - A1^2) --> the results it's 2.718281828!
wonderful

the bug is the same in 2003-2007-2010 versions.

I'm not sure that I understand your issue. Sorry if I've misunderstood,
but the formula

=-A1^2 (which in your example gives the result 1)

will not give the same result as

=-(A1^2) (which would give -1)

This is by design. See the following page on operator precedence:

http://office.microsoft.com/en-us/excel-help/calculation-operators-and-
precedence-HP010078886.aspx

Regards,

Ian
 
A

Asto

ok thanks,
in the operator precedence page there is the explanation.
Anyway I'm sure that for a user is not clear why a "-" has precedence
on ^.
Simply the formula = - A1^2 should mean = - A1*A1.
regards

Asto
 
A

Asto

ok, thanks,
in the operator reference page there is the explanation.
Anyway I'm sure that for a user is not clear why "-" has precedence on
"^".
Simply = - A1^2 should means =- A1*A1.
Regards

Asto
 
H

Hans Terkelsen

Asto said:
Dears,
let me say that something is going wrong:

- put in cell A1 the number 1
- type in another cell =A1^2 --> the results it's 1. well...
- type in another cell = - A1^2 --> the results it's 1 again!
- try with = 0 - A1^2 --> the results it's -1 ! hahaha
- =exp( - A1^2) --> the results it's 2.718281828!
wonderful

the bug is the same in 2003-2007-2010 versions.
Best wishes

Asto

Asto, this has bothered me too.
VB has the other convention, more familiar to math students.
In Excel the sign operator takes precedence over ^,
but the minus operator does not. Both use - as the operator sign.
0-A1^2 works as expected.
One just has to remember the issue.
Hans T.
 

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

Top