<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:lemoyne.castle@gmail.com" title="LeMoyne Castle <lemoyne.castle@gmail.com>"> <span class="fn">LeMoyne Castle</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - Erroneous calculation in IF statements (order of operations)"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=107519">bug 107519</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEEDINFO
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>NOTABUG
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - Erroneous calculation in IF statements (order of operations)"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=107519#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - Erroneous calculation in IF statements (order of operations)"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=107519">bug 107519</a>
              from <span class="vcard"><a class="email" href="mailto:lemoyne.castle@gmail.com" title="LeMoyne Castle <lemoyne.castle@gmail.com>"> <span class="fn">LeMoyne Castle</span></a>
</span></b>
        <pre>A few notes: 

The SUM() function takes a semicolon separated list of values (or cells or
ranges).  The reported examples give only one value as an expression, so the
SUM function is not required here because SUM(x) == x.  See simplification at
end.

The two expressions within the SUM call are not the same, although they appear
to be equivalent (should produce the same result).  Doing the math by hand
either way, the correct result 1099440 is obtained.
first:  SUM( F6+$E$3 ) * (1+$E$2)  ==> 1099440 [correct] 
second: SUM( (F6+$E$3)*(1+$E$2) )  ==> 1099440 [correct]
(1000000 + 18000) * (1 + 0.08) = (1018000)*1.08 = 1099440

The erroneous result is 1080000
Note: 1080000 == (F6) * (1+$E$2) 
But this is the expression for the else clause in the =IF( ) formula that is
actually producing the 'erroneous' result...

I submit that $B$20 > F6 == 1000000 and the else result is being shown and
SUM() is not even being called.

Here is a simplification that may help: 
don't use the SUM function, just use the expression  (F6+$E$3)*(1+$E$2)

Unless there is a document that demonstrates this error in Calc, it is not a
bug.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>