Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Order of Operations

Status
Not open for further replies.

Irontrussman

Structural
Aug 29, 2008
10
US
I was browsing through the threads and came across a warning, and ensuing discussion (thread404-157296), on whether Excel should calculate the expression -5^2 as equal to 25 or -25. If you use the Excel function Power(number,power) then there is no ambiguity. If you want to square -5 then you would enter, =Power(-5,2). If you want to negate the square of 5, then you would enter =-power(5,2).
 
I think that only applies in base 10.
 
The Power method is no different from proper use of parenthesis except that it takes five additional keystrokes. =Power(-5,2) does exactly the same thing as (-5)^2, and =-Power(5,2) does exactly the same thing as -(5^2). That is, it forces Excel to evaluate in the order you want.

-handleman, CSWP (The new, easy test)
 
irontrussman said:
.. on whether Excel should calculate the expression -5^2 as equal to 25 or -25
So which was it? ;-)

The Power method is no different from proper use of parenthesis except that it takes five additional keystrokes.
Lol. Good point.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
It equals 25. -5^2 = (-5)^2 not -1 x (5^2)

And as far as operation order, if you remember your high school math class in the absence of parenthesis the equation should be computed by taking powers/squares first, then multiply/divide, and lastly add/subtract.

ISZ
 
Please, let's not get into that argument here. It was sufficiently addressed (thrashed to death) in the referenced thread.

-handleman, CSWP (The new, easy test)
 
Any engineer using Excel for real work deserves all the ambiguities it throws at them.

As hammers go, Excel isn't a good one.

- Steve
 
IceStationZebra (Mechanical) 18 Sep 08 22:49
It equals 25. -5^2 = (-5)^2 not -1 x (5^2)

No way! It equals -25. -5^2 = -(5)^2 = -1 x (5^2)
Check any algebra book.

Regards
 
This thread is merely repeating the arguments that were in thread404-157296.

The end conclusion in that thread was: use parentheses so you get the answer you expect.

Patricia Lougheed

Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of the Eng-Tips Forums.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top