How are curly brackets used in Excel
|
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 - .
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
Example
1 : The wrong answer !
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
50
|
=C12+C13*C14
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
You may
expect that 10 + 20 would 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
|
|
|
|
|
|
|
|
60
|
=(C27+C28)*C29
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
By
placing brackets around (10+20) Excel performs this
|
|
|
|||
|
|
part of
the calulation first, resulting in 30
|
|
|
|
||
|
|
Then
the 30 is multipled by 2 resulting in 60
|
|
|
|
No comments:
Post a Comment