Hacker News new | ask | show | jobs
by sheetjs 4335 days ago
> if(iserror(formula), 0, formula)

The IFERROR function was designed for this pattern:

    IFERROR(formula, 0)
2 comments

IFERROR was introduced in Excel 2007, and is not compatible with the old-school .xls files. I haven't had to worry about 2003 in the wild in a few years, but some tools may not have migrated to the new file format.
> is not compatible with the old-school .xls files

You can save as XLS (97-2003) files and Excel serializes the formula using the name `_xlfn.IFERROR`. The file obviously doesn't work in older versions of Excel but will work in 2007+

The mapping for new function names is defined in section 2.2.3 of [MS-XLSX] https://github.com/SheetJS/js-xls/blob/master/bits/69_formta...

Oh that's very convenient, thanks. As another person replying said, I only migrated from 2003 a few months ago (don't ask) so I still have a lot of new quality of life features to discover :)