Wrong formula answers

  • Thread starter Thread starter Kevin G
  • Start date Start date
K

Kevin G

Anybody have any idea why I am getting wrong answers for simple math
formulas. (39+37)+(32-28)/2 is giving me a 4 instead of a 3 as the answer?
The formula reads like (C1-C2)+(D2-D1)/2
 
Kevin

It purely a precedence issue. (Check operator precedence in help). The
formula should force all the +,- first using () around them like so

=((39-37)+(32-28))/2

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 
Let me get this straight -
For the example with cell references:
c1=39
c2=37
d2=32
d1=28
Is that what you have? If this is what you have the result of the
formula you listed is 4.
Add another set of parentheses to get Excel to calculate the left side
of the equation before dividing:
=((C1-C2)+(D2-D1))/2
You'll get 3 from this with the above values.

Your example with numbers is calculated as 78. What it is reading is
that you want to add 37 plus 39 (76) to 32 minus 28 divided by 2 (2).

Type "operator precedence" into Excel's help.

If this is the case
 
Back
Top