How can I convert Excel formula to Javascript?

I tried using online Excel formula Beautifier to convert an Excel formula in javascript for use in Adobe Acrobat Pro XI > forms > text field properties > custom calculation Script, but it didn't work.  (I first changed the number of Excel cells for the correct names of the form (Acrobat) in the following calculation fields)

Formula Excel using domain names: 

= IF (goals = 1, GA1, IF (goals = 2, (SUM(GA1,GB1)/2), IF (goals = 3 (SUM(GA1,GB1,GC1)/3), SO (Goals = 4, (SU-M(GA1,GB1,GC1,GD1)/4)))

Calculation Javascript converted using more Web site: 

(Goals = 1, GA1, IF (objectives == 2, ((GA1,GB1)/2), IF (objectives == 3, ((GA1,GB1,GC1)/3), IF (objectives == 4, ((GA1,G B1,GC1,GD1)/4)))))

There is no error message, but no results on the ground. I'd like if someone could help me with this script.  Thank you!!!


Windows 8.1, Acrobat Pro XI

Regardless of this JavaScript, it is not complete. Something a bit more readable would be:

Get the field values as numbers

var goals = + getField("Goals").value;

var GA1 = + getField("GA1").value;

var GB1 = + getField("GB1").value;

var = GC1 + getField("GC1").value;

var GD1 = + getField("GD1").value;

Set this field value

switch (goals) {}

case 1:

Event.Value = GA1;

break;

case 2:

Event.Value = (GA1 + GB1) / 2;

break;

case 3:

Event.Value = (GA1 + GB1, GC1) / 3;

break;

case 4:

Event.Value = (GA1, GB1, GC1 + GD1) / 4;

break;

by default:

Event.Value = "";

break;

}

This assumes you have fields with these names.

Tags: Acrobat

Similar Questions

  • I have written in AS3 and AS2 games. How can I convert them into HTML5/javascript?

    I have written several games in Flash/AS3 and AS2 to play in browsers; They also work on Facebook. I now need to convert because Flash is no longer supported by the tablets and phones; I need to be able to produce versions Android and iOS. Rather than rewrite all this code, I think that the solution can use PhoneGap, but first I have to produce versions that work in javascript/HTML5.

    Help creative cloud with that?

    Thank you

    Mariana

    It depends on the complexity of your games. Generally, a safer bet would be to change the UI and produce games native for iOS and Android using Flash Professional and AIR. If they are fairly simple, you can manually rewrite the game using JavaScript to target the canvas - and keep all the assets they are in Flash Professional.

    There is no reliable solution to automatically convert AS3 JS.

  • How can I convert Excel to PDF?

    I want to convert an excel worksheet to a PDF file.

    Hi worgjb428,

    If you have Acrobat, it is as easy as choosing File > Create > PDF of the file. Then, you select the Excel file and click Open. If you do not have Acrobat, you can try it free for 30 days. See www.adobe.com/products/acrobat.html for more information.

    Best,

    Sara

  • How can I convert a photo in format PDF to Excel?

    How can I convert an image (presentation of the floor plan) in Excel?

    You will need to perform recognition (OCR) text during the conversion process.

    Please confirm if you are using the service ExportPDF or Acrobat.

  • How can I convert table 1 d in a 2D array.

    I have a table 1 d I want to get into an Excel template.  How can I convert a 2D table so I can enter Excel Table.vi easy?

    Be sure to check the correct operation. Solution-Marc adds another row of zeros and I don't know if this is desirable here. (See also)

  • How can I convert a layer into a group?

    Hello

    I have several layers with sublayers in it. The problem: all the layers (containing sublayers) have been open in the pallet layer on opening the document.

    How can I convert a layer into a group preserving the name? Is there a (semi) approach - automatic to convert all sublayers in groups?

    Thank you

    Konrad

    OK, writing a script was not so difficult as expected.

    So, here's a javascript script to convert a layer into a group:

    /**********************************************************
    
    LayerToGroup.jsx
    
    by Konrad Mühler 2013-06-03
    
    DESCRIPTION
    
    Converts an (Sub)layer into a simple group
    
    **********************************************************/
    
    var currentDocument = app.activeDocument; // get current document
    var currentLayer = currentDocument.activeLayer; // get current layer
    
    var newGroup = currentLayer.parent.groupItems.add(); //add new group into the parrents of the current layer
    newGroup.name = currentLayer.name; //set the same name as for the layer
    
    for (i=currentLayer.pageItems.length-1; i>=0; i--) // loop thru all items
    {
        var singleItem = currentLayer.pageItems[i]; // get item
        singleItem.move(newGroup,ElementPlacement.PLACEATBEGINNING); // move item to new group
    }
    
  • How can I add a formula which attaches to other boxes in adobe acrobat pro 11?

    How can I add a formula which attaches to other boxes in adobe?  I can easily put it in excel or word but the difficulty to do in acrobat pro 11.  It is for a contract and required for add, subtract, and multiply different numbers around the page they came.

    This tutorial is a good starting point: http://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations

  • How can I convert my friends to the Game Center on Facebook?

    With the new iOS for my iPod & iPad, I lost all my friends Game Center.  I have two games that I play as I would like.  How can I convert my friends to the Game Center for Facebook friends?

    You do not have. They have two different systems. What you need to do is to start on. For example, if your game has a forum or support page, they may have a way for people to communicate to a friend. Or if they have a facebook page, they probably have a system for "I want to make friends."

    It is now up to the games themselves to put in place the means to a friend using iMessage. You will need to wait for your game to do.

  • How can I convert a page typed into an editable text file

    How can I convert a page typed in an edible text file? I have a 50 page typed (on a typewriter ;-) document I want to convert (scan?) in a format so that I can then open the file in a text editing application (Word?) and edit.

    How is the most effective (and least expensive) way to do it?

    Thank you

    HAL

    < re-titled by host >

    "Edible text file?" You hear as he print on rice paper, so you can serve it up like at dinner side dish? You want someone to eat their words

    I think that the last two multifunction printers, I bought came with some kind of OCR characters (OCR) software as part of the sweeping package.  I guess that's not the greatest.

  • How can I convert an incoming call read only an attachment so I can change it?

    How can I convert an incoming call reads only attachment so that I can change it? Save in Word does not it, and find research peut t.

    So, the problem seems to be that attachments are stored as files read-only by Thunderbird and an application it can open without editing privileges, so you cannot change the. Read-only mode was chosen because these files are kept in a temporary location. For example, if you modify and save the back, they are deleted when Thunderbird is closed, so losing your changes. The idea is to force to save you to a different location. You should be able to do it, then open it from that location with full editing capabilities.

    For a permanent change in this behavior, go in the [tools >] Options > advanced > general tab and click on Config Editor there. After you confirm the warning, copy - paste browser.helperApps.deleteTempFileOnExit into the search bar and switch false to true by double clicking on it. Now, saved attachments are created with read/write permissions, but is more removed when Thunderbird is closed (i.e., stored in % AppData%\Local\Temp).

  • How can I make a cell formula will apply for the entire column? For example D2 appears B2 - C2. How can I copy this formula for each cell in the column?

    How can I make a cell formula will apply for the entire column? For example D2 appears B2 - C2. How can I copy this formula for each cell in the column?

    If you want the formula is the same (B2 - C2) in the cell of each column you must change it as ($B$ - 2$ C$ 2). Then copy it, select the whole column and paste.

  • How can I convert profiles Configfree 5.90.07 ConfigFree 7.2.16?

    How can I convert profiles Configfree 5.90.07 ConfigFree 7.2.16?

    I had on my old NB (M115-S3144) 40 ConfigFree profiles...
    I intend to 'import' in my new NB (M305-S4835) but it does not recognize!

    What can I do?

    Thank you...

    Hello

    I think that this is not possible because you tried to import from another model of laptop.
    I m not very well, but maybe that's a reason why it doesn't work because the ConfigFree software is different.

    Seems you have to re-create these profiles on the laptop Satellite M305.

    Best regards

  • When I download programs from the internet, they appear just in the form of collections of files TextEditor. How can I convert them into a program.

    When I download programs from the internet, they appear just in the form of collections of files TextEditor. How can I convert them into a program.

    What kind of programs? When you download from? How do download you them?

  • I have Pages version 5.6.1. How can I convert a document that I create in this version to an older version (Maverick) of Pages? I created documents in version 5.6.1 and I need for my colleague to open documents, but it has the ol

    I have Pages version 5.6.1. How can I convert a document that I create in this version to an older version (Maverick) of Pages? I created documents in version 5.6.1 and I need for my colleague to be able to open the documents, but it has the old version. I already clicked on 'option' and select 'duplicate' to get the prompt "save under". However, when I do this it does not to choose another version.

    To create a document that can be opened with previous versions of Pages, open the document in Pages, and go to the menu file (in the menu bar)-> export as-> Pages ' 09. Save the file and send it to your friend, if she can open it without any problem.

  • How can I convert 2400 (0 x 960) in 60 and 9 where 9 and 60 the fourth and fifth elements of an array?

    How can I convert 2400 (0 x 960) in 60 and 9 where 9 and 60 the fourth and fifth elements of an array of 8 elements?

    Thank you.

    Simplified version.

Maybe you are looking for