Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

How do I convert Excel formula to Javascript?

$
0
0

I tried using Online Excel Formula Beautifier to convert an Excel formula to javascript for use in Adobe Acrobat Pro XI >Forms>Text Field Properties>Custom Calculation Script but it didn't work.  (I first changed the Excel cell numbers to the correct names of the (Acrobat) form fields in the following calculation)

 

Excel formula using field names: 

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

 

Converted Javascript calculation using above website: 

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

 

There is no error message, but no results in the field. I would love it if someone could help me with this script.  Thanks!!!


Windows 8.1, Acrobat Pro XI


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>