View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.misc
Dominic LeVasseur
 
Posts: n/a
Default Order of calculation

Louise,

Perhaps you could think of the parentheses as a way to tell Excel to do THIS
"first", or "independently".

So your formula:

=10+10*2+2*10

Without parentheses, the normal order of operation, Left to Right, would
apply.

X / + -

So 10*2 would happen first, then 2*10. Then 10 + 20 (the result of 10*2).
Then 30 (the result of the former) plus 20 (the result of 2*10).

In other words, all Multiplication first, then all the addition.

With parentheses:

=((10+10)*2+2)*10

Remember the parentheses say do this "first", or "independently".

The 10+10 is inside its own set of parentheses, so that tells Excel to do
this independently, which comes up with 20. Then we have a *2+2. Remember
left to right, * comes before +, so then we do a *2. This gives us 40. Then
we add two (because the +2 comes inside the larger set of parentheses, we do
this before the *10). This gives us 42. Then we do the *10.

Does that help at all?



"Louise" wrote:

so, the brackets around 10+10 tells Excel to do that bit first, before it
continues with the rest of the calculation.
What do the brackets around 10+10*2+2 tell Excel to do?
Is it always the very last part of the calculation that doesn't have
brackets around it?

As you can probably tell, maths was never my strongest point and I don't
understand what the second set of bracets are instructing Excel to do.

Thanks again.
Louise

"Roelof van Wyk" wrote:

=((10+10)*2+2)*10

Normal arithmatic applies x / + -