Live data from Hacker News

Excel formulas in JavaScript

github.com

21–30 of 57 posts

Re: Excel formulas in JavaScript

#21
I honestly admire the thought and effort that went into it.

I fear that JavaScript's use of floating point as its single numeric type is likely to create surprising results for the unwary. I have come to the suspicion that the longevity of Excel's dominance is in part due to a sophisticated system for inferring numeric types.

Re: Excel formulas in JavaScript

#23
Very cool!

Slightly related... I reckon a command line / ncurses version of Excel would be really useful. Am I crazy?

e.g. something like http://upload.wikimedia.org/wikipedia/en/e/ec/Lotus-123-3.0-...

Spreadsheets are a pretty useful and powerful tool when it comes to doing ad-hoc data analysis, but it's kind of annoying to get data in and out of them from command line tools.

Re: Excel formulas in JavaScript

#25
post #24

They even included IRR, which is pretty impressive.

IRR is one of those things that is remarkably simple to calculate and grok, but is made difficult in the number of horrendous instructions across the web, many of them simply wrong. Until I corrected it the NPV entry on Wikipedia (NPV being a dependency of IRR) sat with incorrect input / result data.

It all makes me think that some in the financial industry think this is some sort of trade secret.

Re: Excel formulas in JavaScript

#26
post #14
post #3

Earlier quoted context omitted.

Stringing this together with other libraries like http://github.com/warpech/jquery-handsontable and http://github.com/SheetJS/js-xlsx and http://github.com/SheetJS/js-xls could lead to a better web spreadsheet. EDIT: someone already thought about combining those libraries: http://SheetJS.github.io

There's a really nice XLSX reader and writer by Stephen Hardy, a Microsoft developer: https://github.com/stephen-hardy/xlsx.js/ blog post: http://blog.innovatejs.com/?p=24

I looked at that project but it uses a really strange non-free license that should be avoided. https://github.com/stephen-hardy/xlsx.js/issues/8

Re: Excel formulas in JavaScript

#28
post #23

Very cool! Slightly related... I reckon a command line / ncurses version of Excel would be really useful. Am I crazy? e.g. something like http://upload.wikimedia.org/wikipedia/en/e/ec/Lotus-123-3.0-... Spreadsheets are a pretty useful and powerful tool when it comes to doing ad-hoc data analysis, but it's kind of annoying to get data in and out of them from command line tools.

I'm actually working on this, although for various reasons I had to reimplement the formula parser (corner cases are a pain). Screenshot (in progress): http://i.imgur.com/snyBhYH.png

Re: Excel formulas in JavaScript

#29

I've been trying to find which js file has the actual meat of the implementation, but didn't manage to find it. function.js seems the biggest candidate, but didn't contain that much. The rest are all minified other JS libraries or bootstrapping. Any hint on where the actual mapping of names to formulas, and implementation of the formulas, is? Thanks. As for the unimplemented.js formulas, for Gamma you could use the l…

It primarily strings together other libraries. Most of the functions are provided by other libraries like moment.js and numeral.js

Re: Excel formulas in JavaScript

#30
post #9

Any support for i18n? (For English-only speakers: Excel's translation to other languages goes as far as translating function names, thus rendering non-English Excel users' knowledge useless when confronted with an English Excel. E.g., IF(ROUND(A1)=1,B1,C1) in English Excel is JEŻELI(ZAOKR.DO.CAŁK(A1)=1,B1,C1) in Polish Excel -- yes, with all those funky non-ASCII letters.)

It provides a set of JavaScript functions. It doesn't try to parse formulas. You probably could go back and define aliases for each function
Post reply on HN