2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【スプレッドシート】セルの参照を変数化する

Posted at

対象の行・列をGASやら関数でゴニョゴニョ計算して求めた結果A2という文字列が得られたとして、そのセルを参照するやり方のメモ。

INDIRECT関数を使う

INDIRECT関数の第一引数にセル参照の文字列を指定すると参照できます。

=INDIRECT("A2")
image.png

行・列が数値の場合はADDRESS関数を併用する

ゴニョゴニョ計算して求めた結果が21(2行・1列)みたいな場合、ADDRESS関数を併用します。
ADDRESSでセル参照文字列を取得してINDIRECTに渡します。

=INDIRECT(ADDRESS(2, 1))
image.png

参考

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?