www.webdeveloper.com
Results 1 to 3 of 3

Thread: convert excel formula to js

  1. #1
    Join Date
    Aug 2013
    Posts
    2

    convert excel formula to js

    Hello all,

    Can anyone help me convert this formula to Javascript:

    =IF(AD6>AE6;(AD6-AE6)*0,5;0)

    AE6 = 48

    Ty

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,434

    Lightbulb

    This will convert your formula, but I can't help to think it is not what you want
    as either display will result in the setting of the cell in question to 0 (zero).

    Code:
    <!DOCTYPE HTML>
    <html>
    <head>
    <title> Untitled </title>
    <meta charset="utf-8">
    
    </head>
    <body>
    
    <script type="text/javascript">
    // =IF(AD6>AE6;(AD6-AE6)*0,5;0)
    // AE6 = 48
    
      var AD6 = 50;  // alter this value above and below 48
      var AE6 = 48;
      if (AD6 > AE6) { alert('True result: '+(AD6-AE6)*0); }
                else { alert('False result: '+0); }
    </script>
    
    </body>
    </html>

  3. #3
    Join Date
    Aug 2013
    Posts
    2
    Thanks for your help

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles