Access (Excel) parentheses

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
 
V

Van T. Dinh

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).
 
S

Sigurd Bruteig

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
 
V

Van T. Dinh

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 *.
 
S

Sigurd Bruteig

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)
 
Top