CELL in Google Sheets needs two arguments and has no filename info type — Excel port fix
Updated
Excel’s CELL can take only an info type, and it also accepts types such as filename and format. People paste those formulas into Google Sheets and they fail. Official Help requires two arguments — CELL(info_type, reference) — and lists nine info types. filename is not one of them. The arity error looks like the sentence on wrong number of arguments, but that page is VLOOKUP (and the IFERROR trap around it). This page is CELL, including the types Sheets will not evaluate.
Keep the Google Sheets UI in English.
Official Help: CELL.
Recreate it on a blank sheet
Section titled “Recreate it on a blank sheet”- Open a blank spreadsheet. Rename the first tab
Summaryif you want the sheet-name control to be obvious. In A1 typelabel. In A2 typeWidget. In A3 enter=DATE(2024,5,6)and format A3 as a date.
Two arguments, as control. In C1 type address. In C2 enter =CELL("address", A2). C2 is the absolute address of A2 as text, such as $A$2. In C4 type sheet. In C5 enter =CELL("sheet", A2). C5 is the tab name (on the live sheet this tab was named cell-info). In C7 type type. In C8 enter =CELL("type", A2). Official Help: l means a label (plain text). In C9 enter =CELL("type", A3). C9 is v (a value): a date is not a “date” type here. Leave C2, C5, and C8 as the control.
One argument, the Excel form. In E1 type one_arg. In E2 enter =CELL("address"). The cell errors. The live English tooltip is Wrong number of arguments to CELL. Expected 2 arguments, but got 1 arguments. The cell is #N/A. Leave E2 broken. In E4 enter =CELL("filename"). E4 is also #N/A and fails the same arity rule before the type is even checked. Leave E4 broken.
An unofficial type, with two arguments. In E6 enter =CELL("filename", A2). Official Help does not list filename. The cell is #VALUE!. The live English tooltip is: Function CELL parameter 1 value is filename. It should be one of: 'ADDRESS', 'COL', 'COLOR', 'CONTENTS', 'PREFIX', 'ROW', 'TYPE', 'WIDTH', 'SHEET'. In E8 enter =CELL("format", A2). Official Help does not list format either. E8 is also #VALUE!. Leave E6 and E8 broken.
Meanings that are easy to misread. In G1 type width. Make column A narrow or wide, then in G2 enter =CELL("width", A2). Official Help: this is how many 0 characters fit, at the default font size, not the pixel width you see in the column header. In G4 type color. Format A5 as a number with a custom format that paints negatives red, such as #,##0_);[Red](#,##0), and type -3 in A5. In G5 enter =CELL("color", A5). Official Help: 1 if that red-negative format is on, otherwise 0. It is not the fill color. In G7 type prefix. In G8 enter =CELL("prefix", A2). Official Help: this is horizontal alignment (' left, " right, ^ center, empty otherwise). It is not the apostrophe you type to keep a code as text; that prefix is leading zeros and CSV leading apostrophe.
The tab number is a different function. In C11 enter =SHEET(A2). C11 is 1 if Summary is the first tab. C5 is the name. See SHEET vs SHEETS.
What is actually wrong
Section titled “What is actually wrong”- Official Help’s syntax is
CELL(info_type, reference). Both arguments are required. Excel’s one-argument form, which often means “the last edited cell,” is not a Sheets form. - Official
info_typevalues are only:address,col,color,contents,prefix,row,type,width, andsheet. There is no official type for the file path, the number format string, protection, or parentheses-style formatting. CELL("sheet", reference)returns the tab name as text.SHEET(reference)returns the tab position as a number. They are not aliases.CELL("width", reference)is a character count based on the glyph0. Official Help says this is different from the pixel width Sheets uses elsewhere.CELL("color", reference)is a 1 or 0 for the red-negative number format on the top-left cell, not a fill, not a font color.CELL("prefix", reference)is alignment. It will not tell you whether the formula bar still shows a leading apostrophe on a text code.CELL("type", reference)is onlyb(blank),l(plain text), orv(anything else, including numbers and dates). It is not a format inspector.
This is not wrong number of arguments. That primer is VLOOKUP with a fifth argument, and IFERROR swallowing the tooltip. If you need the arity sentence for CELL, stay on this page and transcribe E2.
This is not unknown function. CELL exists. An unofficial type is a bad argument, not a missing function name.
This is not TO_TEXT preserves format. CELL("contents", A3) is the stored value, not a workaround for filename.
Leave E2 and E6 broken so the Excel forms stay visible.
Add the reference. In F2 enter =CELL("address", A2). F2 matches C2. Every working formula on this page has a second argument.
Replace filename and format. Sheets will not return the workbook path from CELL. If you need a tab name, use =CELL("sheet", A2) or build an address with =CELL("address", A2). If you need a format string, there is no official CELL type for it; use TEXT for a display you control, or inspect the format in the UI. Do not strip _xlfn. off an imported Excel formula and assume filename starts working.
Use SHEET for a position. Keep C11 as =SHEET(A2). See SHEET vs SHEETS if you also need a count of tabs.
Do not wrap E2 in IFERROR and then try filename again inside it. You would hide the arity tooltip and still have no path. See IFERROR hides cause.
If CELL names one argument in the hover, add the reference. If both arguments are present and the type is filename or format, that type is not on the official list — transcribe the hover and pick a type that is. If width disagrees with the pixel header, both can be right. If color is 0 on a cell you filled with red, you were asking about a negative number format, not the fill.