Formula Parse Error in Google Sheets: Fix Pasted Formulas
Google Sheets shows #ERROR! and Formula parse error when it can't read a formula. Check locale separators, curly quotes, sheet names and Excel syntax.
On this page
A cell shows #ERROR!, and when you hover over it the note says “Formula parse error.” Sheets couldn’t read the formula as written, so it never got as far as calculating anything. That makes it a punctuation problem, and most of the time the formula was pasted in from Excel, a blog, a chat message, or a spreadsheet set to another country.
Here’s the sample used throughout. Make a tab named Q1 Sales and type this into A1:C7, with the amounts as plain numbers:
| A | B | C | |
|---|---|---|---|
| 1 | Region | Rep | Amount |
| 2 | East | Maya | 1200 |
| 3 | West | Leon | 850 |
| 4 | East | Nina | 640 |
| 5 | South | Omar | 720 |
| 6 | West | Priya | 950 |
| 7 | East | Theo | 410 |
In a spreadsheet set to the United States locale, this is the formula the broken versions below are trying to be:
=SUMIF(A2:A7,"East",C2:C7)
It returns 2250, the three East rows added together. Unless a section says otherwise, the formulas go in empty cells on the Q1 Sales tab.
Commas in a spreadsheet that expects semicolons
The separator between arguments depends on the spreadsheet’s locale, not on your computer. Open File > Settings and look at Locale on the General tab (Google’s page on these settings). Locales that write decimals with a comma, Germany for example, separate arguments with semicolons.
I switched the test spreadsheet to Germany and pasted the US formula. It returned #ERROR!. The semicolon version returned 2250:
=SUMIF(A2:A7;"East";C2:C7)
The other direction is forgiving. Back in the United States locale, the semicolon version was accepted, Sheets rewrote it with commas, and it returned 2250. So in a US-locale sheet, separators are rarely why a pasted formula fails. If your sheet uses comma decimals, they’re the first thing to check.
Changing the locale to suit one pasted formula is the wrong fix. The setting also changes number, date, and currency formats for everyone on the file. Edit the formula instead. Formulas that already work are safe either way: when I changed the locale, the existing SUMIF was redisplayed with semicolons and kept returning 2250.
Array braces fail quietly
Inside {} the comma separates columns and the semicolon separates rows. ={1,2;3,4} fills a 2×2 block in a US-locale sheet. Comma-decimal locales use a backslash for the column separator instead, as Google notes in Using arrays in Google Sheets:
={1\2;3\4}
In the German-locale sheet that produced the same 2×2 block. In the US-locale sheet it was a parse error.
The case to watch for is the US version pasted into a German-locale sheet. ={1,2;3,4} gave no error at all. It returned one column holding 1.2 and 3.4, because the commas were read as decimal points. If a pasted array formula “works” but the numbers look odd, count its columns.
Curly quotes from Word, Slack, or a web page
Word processors and many websites turn straight quotes into typographic ones. The formula looks right and fails:
=SUMIF(A2:A7,“East”,C2:C7)
That returned #ERROR!. Retype both double quotes in the formula bar and it returns 2250. Curly single quotes do the same damage around a sheet name: =‘Q1 Sales’!B2 was also a parse error.
Unless your sheet uses comma decimals, this is the check I’d make first. It takes seconds, and in some fonts the two kinds of quote are almost impossible to tell apart.
Finding the character in a long formula
If you can’t see the culprit, keep a copy of the formula as text and let Sheets point at it. Type an apostrophe followed by the formula into E10:
'=SUMIF(A2:A7,“East”,C2:C7)
The apostrophe makes the cell store text and doesn’t count as a character, so check the formula bar if you’re unsure what’s in the cell. Then, in another cell:
=IFERROR(FIND(UNICHAR(8220),E10),0)
That returns 14, the position of the opening curly quote. Swap in 8221 for the closing quote and it returns 19. To read the code of a single position, =UNICODE(MID(E10,14,1)) returns 8220; a straight double quote would be 34.
Excel syntax Sheets doesn’t read
Plenty of Excel formulas paste into Sheets unchanged. These parts don’t.
Table references
Sheets has its own tables now, and they accept references like Table1[Amount] (see Use table references in Google Sheets). The reference works only when a Sheets table with that exact name and column exists. Typed into the sample, which is an ordinary range with no table, =SUM(Table1[Amount]) returned #ERROR!. So did a misspelled column and a table name that didn’t exist. You get a parse error in those cases, not #NAME?.
After I copied the sample to a tab named T and turned its A1:C7 into a table named Table1, a freshly typed =SUM(Table1[Amount]) returned 4770. The copy I’d typed earlier, before the table existed, still showed #ERROR! until I re-entered it. If you create the table after pasting, click into each formula and press Enter.
Excel’s this-row shorthand is the part that doesn’t carry over. =Table1[@Amount]*2 was a parse error even inside a real table. Google’s help page says #This Row isn’t supported. When I typed the long form, =Table1[[#This Row],[Amount]]*2, in row 3 of the table, Sheets converted it to the plain reference =T!$C3*2 and returned 1700. I wouldn’t rely on that conversion. On an ordinary range, write the cell reference yourself: =C2*2 returns 2400.
The @ sign and _xlfn. prefixes
Excel 365 adds @, the implicit intersection operator, to some formulas, often ones first written in an older version. It tells Excel to return one value where a range could return several. Sheets rejects it, and =@C2 returned #ERROR!. When the formula is that simple, deleting the @ is the fix, and =C2 returns 1200. In a longer formula, work out what the @ was limiting before you remove it.
Formulas copied out of some exported or converted workbooks carry a _xlfn. prefix on newer functions. Those don’t produce a parse error. =_xlfn.SINGLE(C2) and =_xlfn.XLOOKUP("Leon",B2:B7,C2:C7) both returned #NAME? with “Unknown function”. Delete the prefix and check that the function exists in Sheets. The #NAME? guide covers functions that exist in only one of the two apps.
Sheet names with a space need single quotes
From a second tab called Summary:
=Q1 Sales!B2
returned #ERROR!, because the space ends the reference early. Wrap the name in straight single quotes:
='Q1 Sales'!B2
That returns Maya, and =SUM('Q1 Sales'!C2:C7) returns 4770. A name without spaces needs no quotes. The safest habit is to start the formula, click over to the other tab and select the cells, and let Sheets write the reference for you.
A missing bracket, quote, or ampersand
When separators and quotes check out, look at the structure. Each of these returned #ERROR! in the US-locale sheet, next to the version that works:
| Broken | Fixed | Returns |
|---|---|---|
=SUM(C2:C7 | =SUM(C2:C7) | 4770 |
=SUMIF(A2:A7,"East,C2:C7) | =SUMIF(A2:A7,"East",C2:C7) | 2250 |
="Total: "C2 | ="Total: "&C2 | Total: 1200 |
The second row is easy to misread. Without the closing quote, everything after "East becomes part of one unfinished text string. In a long nested formula, match brackets one function at a time from the innermost outward instead of adding ) to the end until the error goes away.
Extra equals and plus signs
A paste that lands on top of an existing = leaves ==SUM(C2:C7), which is a parse error. So is a formula ending in an operator, such as =SUM(C2:C7)+. Remove the extra character and =SUM(C2:C7) returns 4770.
A leading plus is fine after the equals sign: =+SUM(C2:C7) returned 4770. Before the equals sign it isn’t fine, and +=SUM(C2:C7) returned #ERROR!.
What #ERROR! is not
Wrapping the formula in IFERROR won’t help. =IFERROR(SUMIF(A2:A7,“East”,C2:C7),0) still showed #ERROR!, because Sheets never read the formula far enough to run IFERROR. Errors like #NAME? and #VALUE! come from formulas that were read and then failed while calculating, and IFERROR does swallow those. For the second kind, see the #VALUE! guide.
Two lookalikes have their own pages. “Unable to parse query string” comes from the query text inside QUERY, not the formula around it; see fixing QUERY parse errors. And a cell that shows =SUM(C2:C7) as text instead of an error was entered as text; see formula showing as text, which was tested in Sheets as well.
For a freshly pasted formula, my order is: separators first if the sheet uses comma decimals, otherwise the quotes, then Excel-only syntax, then brackets. Where the formula came from usually tells you which of those it is.