Operator precedence (order of operate) =A1/A2*A3^5-(A1+A2)

  • Thread starter Thread starter Masood Shahab
  • Start date Start date
M

Masood Shahab

Hi,
what is the order of operating and calculating in this formula?
=A1/A2*A3^5-(A1+A2)

1- A1+A2

2- A1/A2

3- A3^5

4- A2*A3



Regards.
 
Masood Shahab wrote...
what is the order of operating and calculating in this formula?
=A1/A2*A3^5-(A1+A2)

Same as

=((A1/A2)*(A3^5))-(A1+A2)

There are 3 different precedence levels in your formula

^
* and /
+ and -

in declining order of precedence. For operators of equal precedence,
Excel evaluates STRICTLY left to right.
 
Dear Harlan Grove

I think parenthesis first calculate.
with your idea
=A1/A2*A3^5-(A1+A2) Same as =((A1/A2)*(A3^5))-(A1+A2)

therefore, A1/A2 (option 2 of the test) is true
is it true?
which option is true?
1- A1+A2
2- A1/A2
3- A3^5
4- A2*A3

Thanks
 
In the following formula, which is first calculated?

=A1/A2*A3^5-(A1+A2)

1- A1+A2
2- A1/A2
3- A3^5
4- A2*A3
 
I think parenthesis first calculate.
with your idea
=A1/A2*A3^5-(A1+A2) Same as =((A1/A2)*(A3^5))-(A1+A2)

therefore, A1/A2 (option 2 of the test) is true
is it true?
which option is true?
1- A1+A2
2- A1/A2
3- A3^5
4- A2*A3

At this point I don't believe I understand what you mean by 'which option is
true?' None are true. All evaluate to numbers. The only question is what the
order of evaluation would be. Strictly speaking, it doesn't matter for
operations of different precedence. A3^5 will be evaluated separately from
A1/A2 and A1+A2. It doesn't matter which of these simple arithmetic
expressions is evaluated first. All that matters is how they're grouped.
 
Strictly in terms of operator precedence:

1) B = A1 + A2
2) C = A3^5
3) D = A1/A2
4) E = D * C
5 ) F = E - B

Whether within the calculation engine (1) happens before (2), I don't
know. It doesn't matter as long as (1) happens before (5). LIkewise, (2)
may happen before (3) or (3) before (2), but both happen before (4).
 
If you check XL help for 'operator precedence' (w/o the quote), the
firt suggested topic will be 'About calculation operators.' It
includes a section on 'The order in which Excel performs operations in
formulas'

To see what XL actually does, enter the formula in a cell, display the
Formula Auditing toolbar, click the 'Evaluate Formula' button.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
Back
Top