Created: 2011-07-14 13:35
Updated: 2019-03-04 07:18
License: other


Excel Formula Utilities for JavaScript

Build Status CDNJS version

Excel Formula Utilities for JavaScript is a library that can be used to pretty print excel formulas or convert excel formulas into JavaScript. The JavaScript generated by this library will not execute on it's own. You'll need to include something like formula.js to cover all the functions from Excel.

##Install using npm npm install excel-formula

Installation for web

Grab the latest js files in the dist folder.

Basic usage for web

    <script src="excel-formula.js" />
        var formattedFormula = excelFormulaUtilities.formatFormulaHTML('IF(1+1=2,"true","false")');

Basic Usage for Node

    var formula = require('excel-formula');
    var formattedFormula = formula.formatFormula('IF(1+1=2,"true","false")');

Node methods

See basic usage above.

    formula.getTokens (formula);
    formula.formatFormula (formula, [opts])

Web methods

excelFormulaUtilities is a global variable.

    excelFormulaUtilities.getTokens (formula);
    excelFormulaUtilities.formatFormula (formula, [opts]) // This will work fine in a pre tag
    excelFormulaUtilities.formatFormulaHTML(formula) // Use this if you want the output as html.
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more