0
0

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.

SpreadSheet: ArrayFormula で二次元配列を作成する

Posted at

これまで、Google SpreadSheet で全ての行に対して特定の演算をするような場合に ArrayFormula を利用していたのですが、ちょっと気になる事があって調べていると ArrayFormula で二次元配列を作成できる事を知り、目から鱗だったので記事で残しておきます。

よくやる使い方

簡単な例として、 ArrayFormula に縦方向の配列を2つ与えて、文字列結合します。

=ARRAYFORMULA({"a";"b";"c"}&"-"&{1;2;3})

2つの配列の要素同士を結合した一次元配列ができます。

一次元配列.png

二次元配列の作り方

ArrayFormula に縦方向の配列と横方向の配列を与えて、文字列結合します。

=ARRAYFORMULA({"a";"b";"c"}&"-"&{1,2,3})

1つ目の配列の各要素に、2つ目の配列を結合した二次元配列ができます。

二次元配列.png

セル参照で表すとこんな感じです。

=ARRAYFORMULA(A2:A4&"-"&A2:C2)
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?