dear all,
i really do not understand if it's me doing something silly of a special feature of Excel.
I do not consider myself a newbie.
I solved my problem, but I was wondering if there are some links with literature explaining a bit better these little features..
I tried 2 expressions:
=(-D3^2+B3^2+C3^2)/(2*B3*C3) (Exp1)
and
=(B3^2+C3^2-D3^2)/(2*B3*C3) (Exp2)
with (tested) integer and double numbers in B,C,D fields
the result is different, with the expression (Exp2) giving the correct result.
then i tried:
=(-(D3^2)+B3^2+C3^2)/(2*B3*C3) (Exp3)
and finally got the same result as (Exp2)..
so maybe I guess Excel change the sign of the field D3 before it makes it square..
But then why (Exp2) is working???
Do you know some links/literature explaining things like this, about how Excel handle fields in case of multiple math calculations?
Thanks!![]()
Last edited by andyHefei; 08-21-2011 at 09:37 PM.
The unary negation operator is the highest precedence among arithmetic operators; -3^2 = 9, not -9
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
but then why (Exp2) is ok?
=(B3^2+C3^2-D3^2)/(2*B3*C3) (Exp2)
is that because here the "-" is arithmetic subtraction and not unary negation operator?
where can i find a lit of these priorities?
thx!
See Help for Calculation operators and precedence
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks