Buat referensi dari teks
=INDIRECT(ref_text, [a1])
| Parameter | Deskripsi |
|---|---|
ref_text |
A reference supplied as text. |
a1 |
[optional] A boolean to indicate A1 or R1C1-style reference. Default is TRUE = A1 style. |
INDIRECT takes two arguments, in a generic syntax like this:
=INDIRECT(ref_text,[a1])
Ref_text is the text string to evaluate as a reference. The second argument, a1, is optional and indicates the "style" of the reference provided. When
=INDIRECT("A1") // returns a reference to A1
=INDIRECT("C5") // returns a reference to C5
=INDIRECT("R1C1",FALSE) // returns a reference to A1
=INDIRECT("R5C3",FALSE) // returns a reference to C5
This happens because SUM doesn't see the text value as a reference; it simply sees a text string:
=SUM(E6)
=SUM("C5:C6")
=0
Notice in the second line below, we still have a text value, but in the third line we have the range C5:C6, and SUM now returns 9:
=SUM(INDIRECT(E6))
=SUM(INDIRECT("C5:C6"))
=SUM(C5:C6)
=9
In the example shown below, INDIRECT is set up to use a variable sheet name. The formula in cell C5 is:
=INDIRECT(B5&"!A1") // sheet name in B5 is variable
If the sheet names in your worksheet include spaces or punctuation, use the formula below:
=INDIRECT("'"&B5&"'!A1") // single quotes added