Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Kevin G
 
Posts: n/a
Default Wrong formula answers

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   Report Post  
Posted to microsoft.public.excel.misc
Nick Hodge
 
Posts: n/a
Default Wrong formula answers

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   Report Post  
Posted to microsoft.public.excel.misc
ward376
 
Posts: n/a
Default Wrong formula answers

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula retrieves wrong data Newmoon Excel Discussion (Misc queries) 2 August 11th 05 04:02 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
What is Wrong with this formula please? Issam LAdki New Users to Excel 4 March 9th 05 02:54 PM
Paste is is copying in formula, but display is wrong. Matt Excel Discussion (Misc queries) 2 December 7th 04 08:37 PM


All times are GMT +1. The time now is 03:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"