Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 HIS "Kevin G" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 Kevin G wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula Problem - interrupted by #VALUE! in other cells!? | Excel Worksheet Functions | |||
Formula retrieves wrong data | Excel Discussion (Misc queries) | |||
Formula checking multiple worksheets | Excel Worksheet Functions | |||
What is Wrong with this formula please? | New Users to Excel | |||
Paste is is copying in formula, but display is wrong. | Excel Discussion (Misc queries) |