Skip to content

This library contains methods to beautify an excel formula. This library also contains functions to convert an excel formula to JavaScript (ECMAScript) or C# and python.

License

Notifications You must be signed in to change notification settings

joshbtn/excelFormulaUtilitiesJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9f00e90 · Jun 29, 2021
Jun 29, 2021
Apr 23, 2020
Dec 11, 2018
Jun 7, 2017
May 22, 2014
Apr 13, 2016
Mar 21, 2017
Oct 16, 2012
Jun 7, 2017
Mar 17, 2021
Mar 17, 2021
Feb 13, 2017
Feb 9, 2016
Dec 12, 2018
Dec 12, 2011
Jun 29, 2021
Oct 14, 2012
Mar 21, 2017
Oct 8, 2015
Dec 11, 2018
Apr 28, 2017
Oct 14, 2012
Mar 17, 2021
Jan 11, 2013
Oct 25, 2012

Repository files navigation

Excel Formula Utilities for JavaScript

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" />
    <script>
        var formattedFormula = excelFormulaUtilities.formatFormulaHTML('IF(1+1=2,"true","false")');
        alert(formattedFormula)
    </script>

Basic Usage for Node

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

Node methods

See basic usage above.

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

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.
    excelFormulaUtilities.formula2JavaScript(formula)
    excelFormulaUtilities.formula2CSharp(formula)

About

This library contains methods to beautify an excel formula. This library also contains functions to convert an excel formula to JavaScript (ECMAScript) or C# and python.

Resources

License

Stars

Watchers

Forks

Packages

No packages published