Based on ewbi's go calc excel formula parser This library contains methods to beautify an excel formula. This library also contains functions to convert an excel formula to JavaScript (ECMAScript) or C#.
JavaScript HTML CSS CoffeeScript

Excel Formula Utilities for JavaScript

Build Status

To submit pull requests for please oppen a pull request after gh-pages branch. To submit pull requests for please use this branch. Changes to the core js library live in the master branch.

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.