Monday, March 14, 2011

Brackets in formula

Sometimes you will need to use brackets, (also known as 'braces'), in formula. This is to ensure that the calculations are performed in the order that you need. The need for brackets occurs when you mix plus or minus with divide or multiply.

Mathematically speaking the * and/are more important than + and - .
The * and / operations will be calculated before + and -.

Example1: The Wrong answer !

10
20
2
Total 50 = C12+C13*C14
You may expect that 10+20 woould equal 30 and then 30*2 would equal 60

But because the * is calculated first Excel sees the calculation as 20*2 resulting in 40 and then 10+40 resulting in 50

Example 2: The correct answer.

10
20
2
Total 60 = (C27+C28)*C29

By placing brackets around (10+20) Excel perfoms this part of the calculation first, resulting in 30 Then the 30 is multipled by 2 resulting in 60.
Twitter Bird Gadget