Access (Excel) parentheses

  • Thread starter Thread starter Sigurd Bruteig
  • Start date Start date
S

Sigurd Bruteig

Hi all!

I have worked out this formula in the access query grid, and after much
trying and failing it works like it should.
Vat:
Sum((((([Price]+([Price]*(NZ([Markup])/100)))*(1-(NZ([Discount])/100))*[Pcs]
))*([Vat])/100))
My problem is that I was asleep when we learned about parentheses at
school.!!
Can someone tell me the rules Access uses when calulating with parentheses?

Sigurd
 
It the same universal rule used in Mathematics: BODMAS

B: Brackets
O: Order, i.e. exponents/powers
DM: Division and Multiplication
AS: Addition and Subtraction

If the operations are of the same order, then do them from Left to Right
(not sure about languages where you write from right to left).
 
Van T. Dinh said:
It the same universal rule used in Mathematics: BODMAS

B: Brackets
O: Order, i.e. exponents/powers
DM: Division and Multiplication
AS: Addition and Subtraction

If the operations are of the same order, then do them from Left to Right
(not sure about languages where you write from right to left).

Thank you!
I suppose bracets is the same as parentheses.
That explain the basic, but what about nested parantheses? I gess the rule
is that the inner parentheses is calculated first?
From excel samples below it looks like that.

2+3*4+3 =17


2+(3*4)+3=17

(2+3)*(4+3)=35


2+(3*(4+3))=23






Sigurd
 
Actually it is much the same as math. It calculates left to right from
the inner most to the outer most level. In other words, it calculates
anything inside the parentheses first.
 
Yes for nested brackets / parentheses. In mathematical order of operations,
parentheses / brackets / braces are the same and you simply use different
set for clarity. For example:

A *{ [ B + C / ( E + F ) ] * G } - H / I

but the meaning of each set of parentheses / bracket / braces is the same.
Of course in Mathematics, we even omit the multiplication sign *.
 
Van T. Dinh said:
Yes for nested brackets / parentheses. In mathematical order of operations,
parentheses / brackets / braces are the same and you simply use different
set for clarity. For example:

A *{ [ B + C / ( E + F ) ] * G } - H / I

but the meaning of each set of parentheses / bracket / braces is the same.
Of course in Mathematics, we even omit the multiplication sign *.

Thank you very much.

Sigurd
(Norway)
 
Back
Top