Repository navigation
Read an error code held in a cell as the error itself (#226) - #233
Merged
Merged
Conversation
A cell holding #N/A, #DIV/0!, #VALUE!, #REF!, #NAME?, #NUM! or #NULL! as a value was text, so SUM stepped over it to a clean-looking total and IFERROR let it through. literalValue now reads the exact code as the error, which covers every way in at once: typing, pasting, opening a file's t="e" cells, and the codes a pivot writes for a group's error. A leading apostrophe, the Text format, and text that only starts with # stay text, and a file's string cell reading "#N/A" keeps its apostrophe on import, as before. Export now takes the error from literalValue instead of a second list of codes. Constant error cells leave the open report (#227): the app keeps them whole now, so nothing about them is lost. Recount to 1984 tests in 141 files; retake picture 27 and the social card. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013pmWZsbmugfpqtYazrzfjj
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Checked in real Excel: a typed #n/a becomes the #N/A error, while a typed #SPILL! stays text. errorLiteral now matches the seven codes ignoring case and returns the error as Excel spells it, so #n/a also goes out to the file as #N/A. The newer codes stay text, now with a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013pmWZsbmugfpqtYazrzfjj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013pmWZsbmugfpqtYazrzfjj
Owner
Author
|
PO review — merged at Verify (local, full): green — 1996 tests, mutants 32/32, a11y 121, e2e 58. CI 17/17 green on the same head. Tried as a user on a production build:
These match what the owner checked in Microsoft Excel this morning (lower case is the error, One cosmetic difference, not blocking: the formula bar on a cell typed as Hold set left: #232 → #51 → #219 → #59. Generated by Claude Code |
6 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Closes #226. Next in the sprint-final queue: #226 → #232 → #51 → #219 → #59.
The bug: a cell holding
#N/A,#DIV/0!,#VALUE!,#REF!,#NAME?,#NUM!or#NULL!as a value was text, becausecellLiteral.tshad no rule for error codes. Formulas that read it went quietly wrong.=SUM(A1:A3)over100, a typed#DIV/0!and80gave180, and=IFERROR(A2,0)let the text through. Since #227 this also covered every constant error cell in an opened file, and since #222 the codes a pivot writes for a group's error.The fix:
literalValue. A cell whose text is one of Excel's seven error codes, in any case, is that error, spelled as Excel spells it. It comes after the apostrophe rule and the Text-format rule, so'#N/Aand a Text-formatted cell stay text. That one rule covers every way in at once: typing, pasting (Excel copies an error cell as its code), opening a file (Opening an .xlsx drops constant error cells to blank, and totals that read them come out as clean numbers #227 already keeps the code), and pivot output (Pivot Sum/Average/Min/Max skip error values silently instead of showing the error #222 already writes the code).#stays text:#1,#N/A please,#hashtag. So do the newer codes such as#SPILL!, as in Excel.#N/Astays text.rawForTextalready gives it an apostrophe wheneverliteralValuewould read it as something else, so this needed no new code. A test pins it.literalValueinstead of the second list of codes Opening an .xlsx drops constant error cells to blank, and totals that read them come out as clean numbers #227 added, so the grid and the file cannot disagree.fileLosses.tsis back to its pre-Opening an .xlsx drops constant error cells to blank, and totals that read them come out as clean numbers #227 shape.Reproduced on
mainfirstmain004a09d100,#DIV/0!(typed),80→=SUM(A1:A3)180#DIV/0!#DIV/0!=IFERROR(A2,0)#DIV/0!(the text)00=IFNA(A4,"none")over a typed#N/A#N/A(the text)nonenonet="e"A1, A2,5,=SUM(A1:A3)5#DIV/0!#DIV/0!=SUM('สรุป'!B2:B3)over a pivot's error cell80#DIV/0!#DIV/0!'#N/A,#N/A please,#1, a file's text cell#N/AChecked in real Excel by the owner (typed into Excel desktop, 2026-10-05). The rest of the Excel column is what #226 itself states.
#n/ain lower case becomes the#N/Aerror. The formula bar shows#N/Aand the cell is centred as an error. This PR now matches it: the seven codes are read in any case and spelled back as Excel spells them, so#n/aalso goes out to the file as#N/A.#SPILL!stays text (left-aligned). This PR keeps the newer codes as text, now with a test.The owner also tried
ISERROR/ISTEXTin the app: onmainthey read#NAME?, which is the missingIS…family below.How it was verified
npm run verify(all ten gates): all ten gates green on1f6644c(the current head)store/errorLiterals.test.ts(new, 4): one test for each way in.SUM,IFERROR,IFNA, and arithmetic over it.#1,#N/A pleaseand'#N/Astaying text.t="e"file, plus a string cell reading#N/Athat stays text.SUMandIFERRORover the pivot sheet.cellLiteral.test.ts(+3): the seven codes; any case spelled back as Excel spells it; and what stays text (apostrophe, Text format,#…text,#SPILL!,rawForText).excelIO.test.ts: Opening an .xlsx drops constant error cells to blank, and totals that read them come out as clean numbers #227's export test had pinned#n/agoing out as text. Excel has now answered that guess the other way, so it goes out as{ error: "#N/A" }.fileLosses.test.ts: the two Opening an .xlsx drops constant error cells to blank, and totals that read them come out as clean numbers #227 tests become one, "constant error cells are not reported".main'scellLiteral.ts, all the new tests fail.main'sfileLosses.ts, the report test fails too.#DIV/0!in red as an error,SUM=#DIV/0!,IFERROR=0,IFNA=none.#N/A pleaseand'#N/Astay plain text.t="e"file opens with A4 =#DIV/0!, where it used to read5. Its text cell#N/Astays plain, and no report appears.#SPILL!stays text.For PO
ISNA,ISERRORandISTEXTare not in the engine, so=ISNA(A1)reads#NAME?. An error code typed, pasted or imported into a cell stays text, so formulas that read it go silently wrong #226's Done list names them. Rather than add three functions here, the tests useIFERRORandIFNA, which the engine has. I suggest a small ticket of its own for theIS…family (ISNA,ISERROR,ISERR,ISTEXT,ISNUMBER,ISBLANK).#N/Afrom a source now lands as the error too, by the same rule. That matches what a paste of the same text does.The branch
This is the session's branch
claude/new-session-m6mehm. The work was written on a local branch frommain004a09d.🤖 Generated with Claude Code
https://claude.ai/code/session_013pmWZsbmugfpqtYazrzfjj