{"slug": "choosing-portable-functions-for-spreadsheets-shared-between-excel-and-google-for", "title": "Choosing Portable Functions for Spreadsheets Shared Between Excel and Google Sheets — Replacing XLOOKUP with SUMIF for Compatibility", "summary": "Tadashi Shigeoka reports that XLOOKUP formulas written in Microsoft Excel can return empty or incorrect results when the .xlsx file is opened in Google Sheets, and recommends replacing XLOOKUP with SUMIF for numeric lookups or INDEX with MATCH for string targets to ensure cross-platform compatibility. The article, published August 5, 2026, outlines a set of portable functions—SUMIF, SUMIFS, SUM, ROUND, IF, and INDEX/MATCH—and suggests adding reconciliation cells to surface conversion errors visibly.", "body_md": "# Choosing Portable Functions for Spreadsheets Shared Between Excel and Google Sheets — Replacing XLOOKUP with SUMIF for Compatibility\n\n[Tadashi Shigeoka](/en/author/tadashi-shigeoka/)· Wed, August 5, 2026\n\nMy current workflow has AI agents like [Claude Code](https://www.anthropic.com/claude-code) and [Codex](https://openai.com/codex/) doing spreadsheet work locally in [Excel](https://www.microsoft.com/en-us/microsoft-365/excel), while the shared, human-facing copy lives in [Google Sheets](https://www.google.com/sheets/about/). In that setup, function compatibility between the two tools quietly becomes an operational bottleneck.\n\nThis post starts from a formula I wrote in Excel that broke the moment I opened the file in Google Sheets, and works out to a small set of rules for picking functions that survive the round trip.\n\n## The Symptom: XLOOKUP Written in Excel Comes Back Empty in Google Sheets\n\nOpen an Excel-authored `.xlsx`\n\nfile in Google Sheets and you can hit a case where the formula is displayed correctly, but the calculated result comes back empty or wrong.\n\nThe culprit this time was an [XLOOKUP](https://support.microsoft.com/en-us/office/xlookup-function-b7fd680e-6d10-43e6-84f9-88eae8bf5929) that pulled values from a lookup table:\n\nXLOOKUP is available in both current Excel and Google Sheets (the Google Sheets side is documented in the [XLOOKUP function help](https://support.google.com/docs/answer/12405947)). So it isn’t a plain “unsupported in Google Sheets” problem.\n\nThe actual failure modes are more like:\n\n- How\n`.xlsx`\n\nformulas get translated into Google Sheets formulas - How stored, precomputed cell values are treated\n- Recalculation timing when the file is opened\n- Excel-specific formula representation and internal function names\n- Dynamic array interpretation\n- Reference range and blank-cell handling\n\nFor the “look up a value by key and aggregate a number” case, I replaced XLOOKUP with the more elementary [SUMIF](https://support.microsoft.com/en-us/office/sumif-function-169b8c99-c05c-4483-a712-1697a653039b):\n\n## XLOOKUP and SUMIF Are Not Identical\n\nThis substitution only works when the target value is numeric and it is acceptable to sum any duplicates on the same key. Broken out by use case:\n\n- Unique key, numeric target: SUMIF works as a drop-in\n- Duplicate keys and you want the sum: SUMIF is the right tool\n- Target is a string: reach for INDEX and MATCH\n- You only want the first match: no simple SUMIF substitute\n\nFor string targets, [INDEX](https://support.microsoft.com/en-us/office/index-function-a5dcf0dd-996d-40a4-a822-b56b061328bd) combined with [MATCH](https://support.microsoft.com/en-us/office/match-function-e8dffd45-c762-47d6-bf89-533f4a37673a) fits the shape of the problem:\n\nINDEX with MATCH has been supported in both Excel and Google Sheets for a long time, and survives the `.xlsx`\n\n↔ Google Sheets round trip cleanly.\n\n## Designing for Portability\n\nFor files that will be opened in both Excel and Google Sheets, centering the design on this small set of primitives keeps the sheet stable:\n\n- Conditional aggregation: SUMIF, SUMIFS\n- Sum: SUM\n- Rounding: ROUND\n- Branching: IF\n- Exact-match lookup: INDEX with MATCH\n- Reconciliation: compare source total and computed total with IF\n\nFor example, a reconciliation cell that checks the computed total against the source total is one line:\n\nWhen you need the sum of line items to hit a fixed invoice total exactly (rounding aside), compute the last row as the balancing difference:\n\nReconciliation cells like these turn a silent breakage during conversion into a visible mismatch on the sheet itself. Keeping formulas simple and adding explicit reconciliation are two halves of the same practice; neither works alone.\n\n## Practical Rules\n\nA function-compatibility matrix alone is not enough to predict Excel ↔ Google Sheets behavior. Even functions that both sides support can produce different results once file conversion or recalculation is inserted between them. The XLOOKUP case above is exactly that pattern.\n\nThe rules of thumb I now use:\n\n- Keep aggregation formulas as simple as possible\n- Pin reference ranges explicitly\n- Separate input data and computed results into different sheets\n- Add reconciliation cells that check for a matching total\n- Actually recalculate in both\n`.xlsx`\n\nand Google Sheets - Verify the formula in the cell, not just the displayed value\n\nRules 5 and 6 matter more, not less, when you are handing this work to an AI agent. The agent will look at Excel’s recalculated result and conclude “it’s correct,” and it takes a human (or a reconciliation cell) to catch the case where the Google Sheets copy silently disagrees.\n\n## Wrap-Up\n\nThe lesson here is not “don’t use XLOOKUP.”\n\nThe point is that for a file that will live in more than one spreadsheet tool, function choice should factor in conversion, recalculation, and reconciliation, not just how convenient the newest function is. Simple functions plus explicit reconciliation cells produce sheets that survive the round trip and are easier for a third party to verify.\n\nThat’s all from replacing XLOOKUP with SUMIF to make an Excel-authored file survive the Google Sheets round trip, from the Gemba.", "url": "https://wpnews.pro/news/choosing-portable-functions-for-spreadsheets-shared-between-excel-and-google-for", "canonical_source": "https://codenote.net/en/posts/excel-google-sheets-portable-functions-xlookup-sumif/", "published_at": "2026-08-05 14:58:23+00:00", "updated_at": "2026-08-19 01:11:53.245190+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents"], "entities": ["Tadashi Shigeoka", "Claude Code", "Codex", "Microsoft Excel", "Google Sheets", "XLOOKUP", "SUMIF", "INDEX"], "alternates": {"html": "https://wpnews.pro/news/choosing-portable-functions-for-spreadsheets-shared-between-excel-and-google-for", "markdown": "https://wpnews.pro/news/choosing-portable-functions-for-spreadsheets-shared-between-excel-and-google-for.md", "text": "https://wpnews.pro/news/choosing-portable-functions-for-spreadsheets-shared-between-excel-and-google-for.txt", "jsonld": "https://wpnews.pro/news/choosing-portable-functions-for-spreadsheets-shared-between-excel-and-google-for.jsonld"}}