INDIRECT #REF! Invalid Reference in Google Sheets

INDIRECT returns #REF! when its first argument is not a valid reference, such as a typo in a tab name, a trailing space, or an empty string.

本文目錄

These three strings all look as if they should point at the same cell:

  • 'Bed 4 West'!B2
  • 'Bed 4 Wset'!B2
  • Bed 4 West!B2

In this file, INDIRECT accepted the first and the third. Both returned 18.5. The second, which names a tab that does not exist, returned #REF!. The message was: Function INDIRECT parameter 1 value is ''Bed 4 Wset'!B2'. It is not a valid cell/range reference.

INDIRECT does not look at a typed A1 reference the way a formula like ='Bed 4 West'!B2 does. It evaluates the text you gave it. If that text is not a valid address in this workbook, you get #REF!, not a blank.

The main tab is Plot Log. Its data occupies A1:C10:

BedCropYield_lb
4Wkale18.5
12Nchard12.0
7Egarlic9.5
3Scarrots22.0
8Wtomatoes31.5
6Nspinach11.0
2Ebeets16.5
10Szucchini27.0
5Wlettuce14.0

A second tab named Bed 4 West holds this detail table in A1:B3:

MeasurementValue
Harvest yield (lb)18.5
Harvest count3

Because Bed 4 West!B2 contains 18.5, this formula in Plot Log!E2 reads that value:

=INDIRECT("'Bed 4 West'!B2")

It returns 18.5. The single quotes around the tab name are part of the reference string. The double quotes only delimit the text passed to INDIRECT.

Google Sheets with E2 selected, showing =INDIRECT("'Bed 4 West'!B2") in the formula bar and 18.5 in E2, read from cell B2 of the Bed 4 West tab.
Screenshot: Google Sheets, Nov 2026

A typo in the tab name returns #REF!

Change two letters in the working reference:

=INDIRECT("'Bed 4 Wset'!B2")

There is no tab named Bed 4 Wset, so the formula returns #REF!. The message is: Function INDIRECT parameter 1 value is ''Bed 4 Wset'!B2'. It is not a valid cell/range reference.

Google Sheets with E2 selected, showing =INDIRECT("'Bed 4 Wset'!B2") in the formula bar and #REF! in E2 beside the Plot Log bed table, because no tab is named Bed 4 Wset.
Screenshot: Google Sheets, Nov 2026

Correcting the tab name inside the text restores 18.5. INDIRECT does not look for a similar sheet name.

The same failure appears when the typo lives in another cell. With Bed 4 Wset in E4:

=INDIRECT("'"&E4&"'!B2")

returns #REF! and the same message, because the constructed address is still 'Bed 4 Wset'!B2. Change E4 to Bed 4 West and the formula returns 18.5 without any other edit. When the tab name comes from a cell, fix that cell first.

A typed reference ='Bed 4 West'!B2 also returned 18.5 in this file. The difference is that its address is written into the formula, whereas INDIRECT evaluates text that might be concatenated, stored in a cell, or typed by hand.

An unquoted name with spaces can still work — until it doesn’t

This formula omits the single quotes around the tab name:

=INDIRECT("Bed 4 West!B2")

It returned 18.5 in this file. Building the same unquoted address from E5, which contains Bed 4 West, also worked:

=INDIRECT(E5&"!B2")

That result is not a reason to skip the quotes. I would still write the name this way, especially when the tab name is assembled from another cell:

=INDIRECT("'"&E5&"'!B2")

It also returns 18.5. A helper cell makes the constructed text visible:

="'"&E5&"'!B2"

displays 'Bed 4 West'!B2.

Quoting does not fix a typo or trim extra characters. It only gives the sheet-name portion the usual syntax. Put Bed 4 West in E6 with a trailing space, and the helper shows 'Bed 4 West '!B2. The matching INDIRECT formula returns #REF!, and the message is: Function INDIRECT parameter 1 value is ''Bed 4 West '!B2'. It is not a valid cell/range reference. There is no tab whose name includes that trailing space.

An empty string is not an address

=INDIRECT("")

returns #REF!. The message is: Function INDIRECT parameter 1 value is ''. It is not a valid cell/range reference.

The same message appears when the argument is a blank cell. Leave E8 empty and enter =INDIRECT(E8) in F8. The result is #REF!, not a blank.

If an empty input is allowed, check for it before calling INDIRECT:

=IF(E8="","",INDIRECT(E8))

With E8 empty, this displayed a blank cell. When the input cell holds a complete address — in E9, the text 'Bed 4 West'!B2 — the same guard returns 18.5.

The guard does not hide a bad address. If the input is 'Bed 4 Wset'!B2, the IF still passes that nonempty string to INDIRECT, which returns #REF! and the typo message above. That is preferable to wrapping the first failure in IFERROR:

=IFERROR(INDIRECT(E17),"")

With the typo address in E17, this displayed a blank and hid the #REF!. A blank output can look like an intentionally empty input.

A bed label is not an A1 reference

The Plot Log table uses identifiers such as 4W, 12N, and 7E. Those values name garden beds, not spreadsheet cells. With 12W in E10:

=INDIRECT(E10)

returns #REF!. The message is: Function INDIRECT parameter 1 value is '12W'. It is not a valid cell/range reference. Sheets did not treat 12W as a usable address in this file.

A label has to be turned into an actual address first. Put 2 in E11:

=INDIRECT("'Bed 4 West'!B"&E11)

This constructs 'Bed 4 West'!B2 and returns 18.5. Change the input to 3 in E12, and the same pattern reads 'Bed 4 West'!B3, which is 3.

A helper cell shows the string before INDIRECT evaluates it:

="'Bed 4 West'!B"&E11

With E11 set to 2, that cell displays 'Bed 4 West'!B2. =INDIRECT(G11) then returns 18.5. I prefer this when an address is assembled from more than one input: you can see whether the string is right before you ask whether the range exists.

A blank row number leaves an incomplete address

Clear E13 and the helper in F13 displays 'Bed 4 West'!B. That text does not include a row.

=INDIRECT(F13)

returns #REF!. The message is: Function INDIRECT parameter 1 value is ''Bed 4 West'!B'. It is not a valid cell/range reference. It did not spill a whole-column result in this file.

Guard the row input rather than passing the incomplete string through:

=IF(E13="","",INDIRECT("'Bed 4 West'!B"&E13))

With E13 empty, this displayed a blank. With E13 set to 2, the same pattern as above returns 18.5. A blank check does not prove that every nonblank value is a usable row number.

A1 text is invalid in R1C1 mode

INDIRECT has an optional second argument. TRUE reads the text as A1 notation. FALSE reads it as R1C1.

=INDIRECT("'Bed 4 West'!B2",TRUE)

returns 18.5. The same A1 string with the mode switched:

=INDIRECT("'Bed 4 West'!B2",FALSE)

returns #REF! and the invalid-reference message, because B2 is not an R1C1 address. The matching R1C1 form is:

=INDIRECT("'Bed 4 West'!R2C2",FALSE)

That returned 18.5. If your generated strings look like B2 或 'Bed 4 West'!B2, leave the second argument TRUE or omit it. Do not flip the mode while troubleshooting a typo.

Inspect the constructed string first

When INDIRECT returns #REF!, look at the first argument after any concatenation has been evaluated. With Bed 4 West in E20, =INDIRECT("'"&E20&"'!B2") returns 18.5. If E20 were the typo Bed 4 Wset, a helper ="'"&E20&"'!B2" would display 'Bed 4 Wset'!B2 and make the misspelling visible without editing the INDIRECT formula itself.

Correct the string, then let INDIRECT evaluate it. If the formula will not parse because its quotation marks or parentheses are malformed, that is a different problem, covered in the formula parse error guide. Other broken references, such as a deleted cell or an INDEX range that does not exist, belong in the broader #REF! guide. If the formula reports #NAME? instead, see the #NAME? error guide.

For an INDIRECT invalid-reference error, read the message, expose the reference text, and compare it with the actual tab name and cell address. In this workbook, the intended string is 'Bed 4 West'!B2, and the value there is 18.5.

Oscar

寫 Excel 與 Google Sheets 的公式和排錯。

Google Sheets, 19 November 2026, new private unshared spreadsheet (locale en_US, 1000-row grid). Formulas were entered as user input through the Sheets API. Error text was read from the Sheets API error message. INDIRECT("'Bed 4 West'!B2") returned 18.5. INDIRECT("'Bed 4 Wset'!B2") returned #REF!, "Function INDIRECT parameter 1 value is 'Bed 4 Wset'!B2'. It is not a valid cell/range reference." The same message appeared for INDIRECT("'"&E4&"'!B2") when E4 was the typo Bed 4 Wset, and for the trailing-space name in E6 (constructed address 'Bed 4 West '!B2). INDIRECT("Bed 4 West!B2") and INDIRECT(E5&"!B2") with E5 equal to Bed 4 West both returned 18.5; the quoted form INDIRECT("'"&E5&"'!B2") also returned 18.5. INDIRECT("") and INDIRECT of a blank cell both returned #REF!, "Function INDIRECT parameter 1 value is ''. It is not a valid cell/range reference." IF(E8="", "", INDIRECT(E8)) displayed blank while E8 was empty; after E9 held 'Bed 4 West'!B2, IF(E9="", "", INDIRECT(E9)) returned 18.5. INDIRECT("12W") returned #REF!, "Function INDIRECT parameter 1 value is '12W'. It is not a valid cell/range reference." INDIRECT("'Bed 4 West'!B"&E11) returned 18.5 when E11 was 2 and 3 when E11 was 3. The helper "'Bed 4 West'!B"&E13 with E13 blank displayed 'Bed 4 West'!B; INDIRECT of that text returned #REF!, "Function INDIRECT parameter 1 value is 'Bed 4 West'!B'. It is not a valid cell/range reference." It did not spill a whole-column result. The IF guard on a blank row selector displayed blank. INDIRECT(..., TRUE) returned 18.5; the same A1 string with FALSE returned #REF! and the invalid-reference message; INDIRECT("'Bed 4 West'!R2C2", FALSE) returned 18.5. IFERROR of a typo address displayed blank and hid the #REF!. A typed ='Bed 4 West'!B2 reference also returned 18.5. Excel was not run.

本主題下一篇:表格錯誤與動態陣列 REGEXEXTRACT Returns #N/A in Google Sheets