excel-mcp-server

haris-musaMIT活跃维护

让 Claude、Cursor 等 AI 通过 MCP 协议直接创建和编辑 Excel 文件,支持图表、数据透视表、切片器和公式,无需安装 Excel。

Excel MCP server: let AI (Claude, Cursor, Codex) create and edit Excel files with charts, PivotTables, slicers and formulas. No Excel required.

v2.3.0发布于 2026-11-09 18:55 UTC4,289star +9 / 7 天481fork同步于 2026-11-10 23:39 UTC

怎么上手

由 README 提炼,执行前请确认
uvx excel-mcp-server stdio --allow-dir /path/to/workbooks
硬件要求按 README 说明

README 未说明 GPU 或显存要求;纯 Python 实现,可跨 Windows、macOS、Linux 运行。创建大型数据透视表时约需 2 GB 内存。

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

让 Claude、Cursor 等 AI 客户端直接创建和编辑 Excel 文件,无需安装 Excel

让 Claude、Cursor 等 AI 通过 MCP 协议直接创建和编辑 Excel 文件,支持图表、数据透视表、切片器和公式,无需安装 Excel。

核心能力

  • 基于 openpyxl 读写 xlsx、xlsm、xltx、xltm 文件
  • 内置公式引擎计算约 260 个函数,无需 Excel 即可返回值
  • 支持图表、数据透视表、切片器、迷你图和条件格式
  • 流式分页读取大表,大表编辑只解析涉及的行
  • 可选 --allow-dir 限制目录、只读模式和原子保存

容易踩的坑

需要先安装 uv,桌面客户端常找不到 uvx,需用 which uvx 输出的完整路径;不传 --allow-dir 时任意绝对路径都可访问,传了则相对路径以该目录为基准;HTTP 模式默认只监听 127.0.0.1:8017,对外暴露需设置 EXCEL_MCP_AUTH_TOKEN 和 --host。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.3.0
  1. v2.3.0v2.3.0: 479 Excel functions, checked against Excel最新正式版2026-11-09 · 2026-11-09 18:55 UTC

    The formula calculator now covers 479 Excel functions (from about 366): statistical distributions, regression, database, engineering, complex-number, securities and LAMBDA helper functions, checked against more than 25,000 results recorded in Excel 16. Every tool was exercised with damaged workbooks and hostile arguments, and every crash that turned up was fixed.

    Added

    • The calculator computes BASE, DECIMAL, FACTDOUBLE, COMBINA, PERMUTATIONA, MULTINOMIAL, SERIESSUM, ARABIC, ROMAN (all five forms), ASINH, ACOSH, ATANH, ACOT, ACOTH, COT, COTH, CSC, CSCH, SEC, SECH, GAMMA, GAMMALN, GAMMALN.PRECISE, ERF, ERF.PRECISE, ERFC, ERFC.PRECISE, GAUSS, PHI, FISHER, FISHERINV, DELTA, GESTEP, CEILING.PRECISE, FLOOR.PRECISE, ISO.CEILING, the conversions between binary, octal, decimal and hexadecimal (BIN2DEC, DEC2HEX, ...), BITAND, BITOR, BITXOR, BITLSHIFT, BITRSHIFT, MMULT, MDETERM, MINVERSE, MUNIT, TRANSPOSE, TOCOL, TOROW, WRAPROWS, WRAPCOLS, EXPAND, TEXTBEFORE, TEXTAFTER, TEXTSPLIT, VALUETOTEXT, ARRAYTOTEXT, ISREF, ISFORMULA, FORMULATEXT, SHEET, SHEETS, AREAS, ADDRESS, and the older names NORMDIST, NORMINV, NORMSDIST, NORMSINV, POISSON, EXPONDIST, BINOMDIST, CONFIDENCE and COVAR. The range intersection operator (a space) is calculated.
    • TEXT and the number formats of exported files support sections with conditions, colours, scientific notation, fractions, elapsed time ([h]:mm), the text section, General, and the 1900 calendar's day 0 and 29 February.
    • The calculator computes the probability distributions with their inverses (BETA.DIST, BETA.INV, CHISQ.DIST, CHISQ.DIST.RT, CHISQ.INV, CHISQ.INV.RT, CHISQ.TEST, F.DIST, F.DIST.RT, F.INV, F.INV.RT, F.TEST, T.DIST, T.DIST.2T, T.DIST.RT, T.INV, T.INV.2T, T.TEST, GAMMA.DIST, GAMMA.INV, WEIBULL.DIST, LOGNORM.DIST, LOGNORM.INV, HYPGEOM.DIST, NEGBINOM.DIST, BINOM.INV, BINOM.DIST.RANGE, CONFIDENCE.T, Z.TEST, PROB, and the older BETADIST, BETAINV, CHIDIST, CHIINV, CHITEST, FDIST, FINV, FTEST, TDIST, TINV, TTEST, GAMMADIST, GAMMAINV, WEIBULL, LOGNORMDIST, LOGINV, HYPGEOMDIST, NEGBINOMDIST, CRITBINOM, ZTEST), regression (LINEST and LOGEST with statistics, several variables and Excel's removal of repeated columns; TREND and GROWTH with several variables), FREQUENCY, MODE.MULT, SKEW.P, TRIMMEAN, STEYX, STDEVA, STDEVPA, VARA, VARPA, ECMA.CEILING, and the twelve database functions (DSUM, DAVERAGE, DCOUNT, DCOUNTA, DGET, DMAX, DMIN, DPRODUCT, DSTDEV, DSTDEVP, DVAR, DVARP) with AND across a row, OR across rows, wildcards, comparison operators and computed criteria.
    • The calculator computes the complex-number functions (COMPLEX, IMREAL, IMAGINARY, IMABS, IMARGUMENT, IMCONJUGATE, IMSUM, IMSUB, IMPRODUCT, IMDIV, IMPOWER, IMSQRT, IMEXP, IMLN, IMLOG10, IMLOG2 and the trigonometric and hyperbolic functions IMSIN to IMCSCH), CONVERT (every unit and prefix Excel has), BESSELI, BESSELJ, BESSELK, BESSELY and ENCODEURL.
    • The calculator computes ACCRINT, ACCRINTM, PRICEMAT, YIELDMAT, ODDFPRICE, ODDFYIELD, ODDLPRICE, ODDLYIELD, AMORLINC and AMORDEGRC, and LAMBDA with BYROW, BYCOL, MAP, REDUCE, SCAN, MAKEARRAY and ISOMITTED, also for a LAMBDA called by the name a LET gave it. COUPDAYS on an actual basis now follows Excel at month-end maturities (found by bisecting 11,500 recorded settlements) and YIELD and the other bond functions at month-ends; where Excel's result cannot be reproduced (ACCRINT and the odd-coupon functions with coupon dates at the end of a month, ACCRINT counted from the first interest date on an actual basis, the statistics of a p
  2. v2.2.92026-11-09 · 2026-11-09 10:27 UTC
    查看更新说明

    Fixed

    • A formula with a long chain of operators (=A1+A1+... up to Excel's 8,192 characters) overflowed the stack of the calculator: read_range reported the cell as uncalculated and trace_formula and goal_seek failed with "Unexpected error". The calculator, the dependency walks and the dynamic array check now loop over operator chains instead of recursing, and calculate them. trace_formula with evaluate refuses a formula more than 150 levels deep with a clear message, and a run of more than 64 % operators counts toward the 64 nesting levels like other nesting.
  3. v2.2.8v2.2.8: security release2026-11-09 · 2026-11-09 09:41 UTC
    查看更新说明

    Security release. Upgrade recommended: uvx excel-mcp-server@latest.

    Security

    • A shared formula (a formula filled down, stored once) is translated for each cell that uses it when a sheet is loaded or streamed, so one long formula shared by many cells kept the server busy far longer than the cells suggested (GHSA-gpj4-f8p7-cg2v, found by the maintainers). The text that a workbook's shared formulas expand to is now counted before any of it is translated and refused past 128 characters per loaded cell on average (--max-loaded-cells times 128), whatever range the file says the formula covers. An array formula whose declared range is larger than --max-cells is refused when the file is edited, instead of filling the range with cells. A shared formula is also taken apart once for the whole group instead of once per cell, which makes loading one several times faster.
  4. v2.2.7v2.2.7: security release2026-11-09 · 2026-11-09 08:25 UTC
    查看更新说明

    Security release. Upgrade recommended: uvx excel-mcp-server@latest.

    Security

    • transform_range (text to columns) and the other tools that build something from what cells hold now count it as they build it and refuse at the limit, so a refused call costs no more than the limit allows (GHSA-g84x-r4rx-gp3v, reported by @arpitjain099). Text to columns counts the pieces as it makes them instead of after splitting every row. One call reads, sorts, compares, exports, searches or returns at most 256 characters of text per cell on average (--max-cells times 256): read_range ends a page when its text reaches that, replace_cells works out a text shared by many cells once and refuses results longer than a cell, import_csv refuses a record with too many fields before reading it, and the calculator counts the text of the cells it reads. PivotTables count the text of their source and refuse a table that the items of its axes would make too large before building it. Table slicers and totals rows no longer make a cell for every row a file declares for its table, and saving refuses a workbook whose text would expand past what the server can open again.

    Fixed

    • A weekday date series with a large step no longer takes time in proportion to the step, and fixed_widths_chars widths must be positive. autofit_columns reads the sheet once however many columns it lists.
  5. v2.2.62026-10-31 · 2026-10-31 19:30 UTC
    查看更新说明

    Fixed

    • A workbook with a table slicer made before a PivotTable slicer or timeline no longer fails to open in Excel: the <ext> entries of the workbook's and sheets' <extLst> are written in the order Excel uses.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Excel MCP Server

    An open-source Model Context Protocol (MCP) server that lets Claude, Cursor, VS Code Copilot, Codex and other AI clients create, read and edit Excel files: charts, PivotTables, formulas, tables and more. It is built on openpyxl, needs no Microsoft Excel, and runs on Windows, macOS and Linux.

    Install and try it at excelmcpserver.com, or see Quick start below.

    Features

    Charts and PivotTables

    • Create Excel charts with AI: column, bar, line, area, pie, doughnut, radar, scatter and bubble, with combos, secondary axes, trendlines and error bars
    • The Excel 2016 chart types: waterfall, histogram, Pareto, box and whisker, treemap, sunburst and funnel
    • Real PivotTables that Excel refreshes (grouping, calculated fields, "show values as", layouts, filters), plus slicers and timelines for PivotTables and tables
    • Sparklines (line, column, win/loss)

    Formulas and dynamic arrays

    • Formulas are calculated without Excel by a built-in engine (about 260 functions, checked against more than 2,500 formulas recorded from real Excel), so read_range returns values for files that were never opened in Excel
    • Dynamic arrays (FILTER, SORT, UNIQUE, SEQUENCE, LET) are stored as Excel stores them and spill into the cells next to them
    • Find out why a number is wrong: trace precedents and dependents across sheets, names and tables, and evaluate a formula step by step as Excel's Evaluate Formula does
    • Goal Seek: change an input until a formula reaches the value you want

    Data, tables and rules

    • Read and write cells, dates and hyperlinks; tables with totals rows and calculated columns
    • Conditional formatting (scales, data bars, icon sets, top/bottom, duplicates, text, dates), data validation (dropdowns, limits, input messages)
    • Sort, filter (with criteria), find and replace, remove duplicates, text to columns, fill series, paste special
    • Fonts, fills, borders, number formats, merged cells, frozen panes, grouping, print setup, sheet protection, images, notes and defined names. Inserting or deleting rows and columns updates every reference, as in Excel

    Large files

    • Reads stream the workbook and return pages, so memory stays flat on sheets with hundreds of thousands of rows; every call is bounded by size and cell limits
    • Edits of a sheet of 1 MB of XML or more parse only the rows they touch, so inserting or deleting rows and columns, sorting, replacing, copying a sheet and creating a PivotTable take seconds on a 200,000-row sheet instead of minutes

    Macros (opt-in)

    • Read the VBA code in .xlsm files. Writing VBA is off unless you start the server with --allow-vba-write, which also decides whether create_workbook and import_workbook may make .xlsm/.xltm files; the server never runs macros

    Safe by design

    • Optional folder confinement, a formula safety check, read-only mode, localhost-only HTTP by default, and atomic saves that never leave a half-written file

    Works with .xlsx, .xlsm (macros are preserved), .xltx and .xltm files. Existing threaded comments, shapes, form controls and other content the tools cannot edit are kept as they are.

    Quick start

    You need uv. Every client runs the server with uvx excel-mcp-server stdio; replace /path/to/workbooks with the folder the server may use. excelmcpserver.com has the same steps with copy buttons and one-click install links for Cursor and VS Code.

    Claude Desktop (Chat): download excel-mcp-server.mcpb from the latest release and open it. Claude asks which folder the server may use.

    Claude Code (the CLI, and the Code tab in Claude Desktop):

    claude mcp add excel --scope user -- uvx excel-mcp-server stdio --allow-dir /path/to/workbooks
    

    Cursor (~/.cursor/mcp.json), and most clients that use an mcpServers config:

    {
      "mcpServers": {
        "excel": {
          "command": "uvx",
          "args": ["excel-mcp-server", "stdio", "--allow-dir", "/path/to/workbooks"]
        }
      }
    }
    

    VS Code with GitHub Copilot (.vscode/mcp.json, note the servers key):

    {
      "servers": {
        "excel": {
          "type": "stdio",
          "command": "uvx",
          "args": ["excel-mcp-server", "stdio", "--allow-dir", "${workspaceFolder}"]
        }
      }
    }
    

    OpenAI Codex (CLI, IDE extension and app):

    codex mcp add excel -- uvx excel-mcp-server stdio --allow-dir /path/to/workbooks
    

    Gemini CLI:

    gemini mcp add -s user excel uvx excel-mcp-server stdio --allow-dir /path/to/workbooks
    

    Devin Desktop:

    devin mcp add -s user excel -- uvx excel-mcp-server stdio --allow-dir /path/to/workbooks
    

    Claude Desktop, manual setup: open Settings, Developer, Edit Config, add the mcpServers JSON above to claude_desktop_config.json, and restart Claude.

    Desktop apps often cannot find uvx, because they do not see your shell's PATH (common on macOS). Use its full path instead, which which uvx prints.

    Choosing which files it can use

    With --allow-dir DIR, the server only opens workbooks inside DIR (subfolders included) and relative paths such as reports/q1.xlsx start there. Repeat the flag to allow several folders, or set EXCEL_FILES_PATH (separate folders with : on macOS/Linux and ; on Windows).

    Without --allow-dir, any absolute path to an Excel file works. In every mode the server only touches Excel files and never silently overwrites an existing workbook.

    Remote use (Streamable HTTP)

    uvx excel-mcp-server streamable-http --allow-dir /srv/workbooks
    

    Clients connect to http://127.0.0.1:8017/mcp. Workbooks live in the --allow-dir folder (default ./excel_files), and export_workbook / import_workbook move files between the server and the client.

    The server listens on localhost only. To accept other machines, set a token and a host:

    EXCEL_MCP_AUTH_TOKEN=change-me uvx excel-mcp-server streamable-http --host 0.0.0.0
    

    Clients then send Authorization: Bearer change-me. Put a TLS-terminating reverse proxy in front of it for use across networks.

    Docker

    docker build -t excel-mcp-server .
    docker run -p 8017:8017 -v "$PWD/workbooks:/data" -e EXCEL_MCP_AUTH_TOKEN=change-me excel-mcp-server
    

    Configuration

    FlagEnvironment variableDefaultMeaning
    --allow-dir DIREXCEL_FILES_PATHnone (stdio), ./excel_files (HTTP)Folders workbooks must be in
    --read-onlyEXCEL_MCP_READ_ONLY=1offOnly offer tools that do not change files
    --allow-vba-writeEXCEL_MCP_ALLOW_VBA_WRITE=1offAdd tools that write VBA macros (see warning below); ignored with --read-only
    --tools AREASEXCEL_MCP_TOOLSallOnly offer the core tools and these comma-separated areas, to save context (see Choosing tools)
    --max-file-mb NEXCEL_MCP_MAX_FILE_MB100Largest workbook the server opens. Also sets the unpacked-size limit (10 times this) that every opened or uploaded workbook must stay under; parts compressed over 500:1 are refused
    --max-cells NEXCEL_MCP_MAX_CELLS100000Most cells one call may read, write or format; reads are still returned in pages
    --max-pivot-cells NEXCEL_MCP_MAX_PIVOT_CELLS3000000Largest PivotTable source in cells (a 230,000-row, 13-column sheet); creating one from the biggest sources takes a minute and about 2 GB of memory
    --max-loaded-cells NEXCEL_MCP_MAX_LOADED_CELLS3000000Most cells and rows of a workbook that may be loaded into memory at once, about 0.5 KB each (a 3,000,000 limit is about 1.5 GB). A workbook with more is refused by the tools that must load whole sheets; read_range and the other streaming reads, and edits of large sheets that parse only some rows, are not limited by the size of the sheet
    --log-level LEVELWARNINGLogging on stderr
    --host HOSTEXCEL_MCP_HOST127.0.0.1HTTP listen address
    --port PORTEXCEL_MCP_PORT8017HTTP port
    EXCEL_MCP_AUTH_TOKENnoneBearer token required on HTTP requests
    --allow-unauthenticatedoffAllow a non-local --host without a token

    Tools

    AreaTools
    Workbookscreate_workbook, describe_workbook, set_workbook_settings, list_workbooks, export_workbook, import_workbook
    CSVimport_csv, export_csv
    Sheetsdescribe_sheet, create_sheet, rename_sheet, copy_sheet, delete_sheet, insert_rows_or_columns, delete_rows_or_columns
    Cellsread_range, write_range, clear_range, copy_range, sort_range, transform_range, find_cells, replace_cells
    Formulastrace_formula, goal_seek
    Formattingformat_range, merge_cells, set_sheet_layout, add_conditional_format, add_data_validation
    Objectsset_table, create_chart, delete_chart, create_pivot_table, delete_pivot_table, add_slicer, delete_slicer, insert_image, delete_image, add_sparklines, delete_sparklines
    Names and notesset_defined_name, delete_defined_name, set_note, delete_note
    Macrosread_vba; with --allow-vba-write: write_vba_module, delete_vba_module

    Choosing tools

    Every tool costs context in every request. --tools offers only the core tools (describe_workbook, describe_sheet, read_range) and the areas you list, for example uvx excel-mcp-server stdio --tools data,charts. It combines with --read-only (read-only tools of the areas) and --allow-vba-write (which also needs the vba area). An unknown area stops the server at startup and lists the valid ones. The sizes are characters of tool descriptions and schemas, at about 3.5 characters per token:

    AreaToolsCharacters
    core (always)describe_workbook, describe_sheet, read_range8,900
    workbookscreate_workbook, set_workbook_settings, list_workbooks, export_workbook, import_workbook2,600
    csvimport_csv, export_csv2,200
    sheetscreate_sheet, rename_sheet, copy_sheet, delete_sheet, insert_rows_or_columns, delete_rows_or_columns2,000
    datawrite_range, clear_range, copy_range, sort_range, transform_range, find_cells, replace_cells6,700
    formulastrace_formula, goal_seek1,300
    formattingformat_range, merge_cells, set_sheet_layout, add_conditional_format, add_data_validation14,000
    tablesset_table1,900
    chartscreate_chart, delete_chart, add_sparklines, delete_sparklines9,900
    pivotscreate_pivot_table, delete_pivot_table4,600
    slicersadd_slicer, delete_slicer2,500
    namesset_defined_name, delete_defined_name900
    notesset_note, delete_note500
    imagesinsert_image, delete_image800
    vbaread_vba; with --allow-vba-write: write_vba_module, delete_vba_module1,900

    CSV

    import_csv reads a .csv or .tsv file into a sheet (created if missing) at a cell, and export_csv writes a range as CSV. Both stay in the allowed folders, within --max-cells and --max-file-mb, and never run anything.

    • Import detects the delimiter from the first record (or takes comma, semicolon, tab, pipe) and reads UTF-8 with or without a BOM, UTF-16 and cp1252. Quoted fields and line breaks inside them are kept.
    • Fields are typed as in Excel's import: numbers (also 1,234.50, 12%; decimal for a decimal comma), TRUE/FALSE and ISO dates (2026-01-31, 2026-01-31 09:30) become values. Text Excel would alter stays text: leading zeros (007), more than 15 digits, a leading +, and numeric dates such as 01/02/2026, which are read only in the date_order you name (dmy or mdy). as_text keeps every field as text.
    • Fields are never formulas. Text starting with =, +, - or @ is stored as text with Excel's quote prefix, so editing the cell does not run it; a number such as -5 is a number.
    • Export writes raw values (full precision, ISO dates) or, with formatted, what Excel shows. Text cells starting with =, +, - or @ get a ' prefix (escape_formulas, on by default) so a spreadsheet that opens the file does not run them; numbers are never prefixed. Datetimes are written as 2026-01-31T09:30:00, which Excel opens as text; use formatted for Excel. Use encoding: utf-8-sig for a BOM, which Excel needs to show accents when it opens a UTF-8 file by double-click. Lines end with CRLF.

    Every parameter is documented in TOOLS.md. Parameters mean the same in every tool:

    ParameterMeaning
    path, sheetThe workbook and the worksheet
    range, atA block of cells (A1:D20), and the top-left cell of whatever is placed there: written values, copies, charts, images, PivotTables, slicers
    sourceWhere data comes from, optionally on another sheet (Data!A1:E200)
    nameThe name of a table, chart, image, PivotTable, slicer or defined name
    _cm, _pt, _charsUnits of sizes: width_cm, row_heights_pt, column_widths_chars

    Tools that change a workbook return what they changed (sheet, range, name) so that the next call can refer to it. Charts and images are selected by name, as listed by describe_sheet.

    Writing macros (opt-in)

    With --allow-vba-write (or EXCEL_MCP_ALLOW_VBA_WRITE=1) the server can set the code of standard, class, workbook and sheet modules in .xlsm and .xltm files, delete standard and class modules, and create or import .xlsm/.xltm workbooks (without the option both are refused, and import_workbook removes macros from uploads to .xlsx/.xltx). The server only stores the code; it never runs it, and Excel asks before enabling macros. Digitally signed VBA projects are refused, since any change would invalidate the signature.

    Warning: macro code runs with your user's rights once you enable macros in Excel. A model that reads untrusted content could be tricked into writing harmful code. Enable this option only for trusted workflows, keep --allow-dir narrow, and read the code before you enable macros. The tools are never offered in --read-only mode.

    Security

    • Formulas are parsed before they are written. Functions that reach the network or other programs (WEBSERVICE, IMAGE, RTD, CALL, Google Sheets IMPORTXML and others), Excel 4.0 macro functions (FILES, GET.WORKBOOK, RUN and others), DDE links and references to other workbooks are rejected. HYPERLINK is accepted with a fixed http(s)://, mailto: or #Sheet!A1 link only.
    • Paths are resolved, including symlinks, before they are checked against the allowed folders. Network (UNC) and Windows device paths are always rejected.
    • A single call processes at most 100,000 cells (--max-cells), and large reads are returned in pages.
    • Cell contents are data from files. The server tells the model not to follow instructions found in them, but review what an assistant does with workbooks from untrusted sources.

    Please report vulnerabilities privately; see SECURITY.md.

    Limitations

    • Formulas are stored in the file, and Excel calculates them when it opens it. So that read_range is useful before that, values mode calculates formulas that have no saved result with a built-in calculator (about 260 functions: math, statistics, financial and bond, dates, text, lookup, logical, LET, sorting and filtering). Results Excel saved are always preferred. A formula the calculator cannot reproduce exactly as Excel does (an unsupported function, a circular reference, or an Excel quirk it does not replicate) is returned as null and listed in uncalculated with the reason; it is never guessed. Ranges in a formula are reduced to the formula's own row or column where Excel's ordinary (not array-entered) formulas do the same, and volatile functions such as RAND are not calculated. The calculator is checked against more than 2,500 formulas recorded from real Excel (tests/fixtures/formula_golden.json).
    • trace_formula and goal_seek use that calculator, so goal_seek refuses a formula it cannot calculate. Where Excel's Trace Precedents shows the cells an OFFSET starts from, trace_formula shows the cells INDIRECT and OFFSET point at; when those cannot be worked out the formula is listed in unknown. Where Excel's search stops at the "may not have found a solution" message, goal_seek may still find a root, and it stores the answer only when it converges (within 0.001 of the target, as Excel does).
    • Functions Excel added after 2007 (IFS, XLOOKUP, STDEV.S, SORT, ...) are written with the _xlfn. prefix Excel expects, wherever formulas are stored (cells, copied and sorted cells, conditional formats, data validation, defined names).
    • Legacy .xls files are not supported; use import_csv for CSV files.
    • PivotTables are created from a snapshot and can use text, number and date columns of up to 3,000,000 cells (--max-pivot-cells); Excel refreshes them from the live source data. They support number formats, "show values as" (percent of total, row, column or parent, difference from, running total, rank), sorting by label or value, date and number grouping, calculated fields, compact, outline and tabular layouts, subtotals on or off, filters with chosen items and several value fields as columns or rows. The figures written into the cells are the ones Excel shows after a refresh, checked against about 200 PivotTables recorded from real Excel (tests/fixtures/pivot_golden.json). The exceptions: items that tie when sorted by value may swap places on refresh, and values_in: "rows" cannot be combined with rank figures or, with subtotals, other figures along a field, because Excel mixes the value fields up there.
    • add_slicer adds slicers (Insert > Slicer) for tables and PivotTables, and timelines for date fields of PivotTables: field, caption, position and size, columns, style, sort, selected items (or a period) and "hide items with no data". Selecting items filters as clicking does: table rows are filtered and hidden; PivotTable items are hidden and the figures recalculated from the source, which Excel confirms on refresh (about 200 PivotTables are checked against Excel, and the slicer variants against Excel's own results). One slicer can filter several PivotTables that share a cache, such as those of copied sheets. Limits: a PivotTable made or refreshed by Excel keeps its figures in the cells (the hidden items and a refresh-on-open mark are stored, so Excel recalculates when it opens the file); fields grouped in a PivotTable take no slicer.
    • Inserting or deleting rows and columns, and renaming a sheet, update references like Excel. Hyperlink targets and 3D references (Sheet1:Sheet3!A1) are left alone (Excel does the same). An edit that cuts through an array formula, a PivotTable, a table header or two tables at once is refused. Inserted cells take the formatting, row height and column width of the line above or to the left (nothing at the first row or column), and calculated table columns are filled into rows inserted in a table.
    • Editing a workbook keeps what the tools cannot change: sparklines, extended conditional formats and validation, slicers and timelines, newer charts (waterfall, histogram, treemap and others), threaded comments, shapes, form controls, linked data types and custom XML stay as Excel saved them and move with inserted or deleted rows and columns and renamed sheets. copy_sheet copies sparklines, slicers and timelines (as Excel does), the Excel 2010 half of conditional formats (data bars, icon sets) and the Excel 2016 charts made by create_chart, but not the others. Deleting a sheet removes slicers that only it used; slicers that would be left without their PivotTable block the deletion, and deleting a table, or the column a table slicer filters, removes the slicer. Digital signatures are removed, as Excel does when a signed file changes.
    • Formulas that return several values (FILTER, SORT, UNIQUE, SEQUENCE, A2:A9*2) are stored as dynamic array formulas, as Excel stores them, and spill into the cells next to them. A cell in the way blocks the spill (Excel shows #SPILL!), and write_range reports it. Where the calculator cannot tell how large a result is, only the formula's cell is stored and Excel fills in the rest when it opens the file.

    Upgrading from 1.x

    Version 2.0 makes tool and parameter names consistent across tools, which breaks 1.x clients and saved prompts. The changelog has a table that maps every 1.x name to its 2.0 replacement: Upgrading from 1.x. Coming from 0.x? See the 1.0.0 notes first.

    Contributing

    Contributions are welcome. See CONTRIBUTING.md.

    License

    MIT. See LICENSE.