1
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 1 year has passed since last update.

ExcelでSUMIFのように条件に一致するセルを文字列連結する

Last updated at Posted at 2022-10-07

はじめに

評価とか、何かしら社員番号毎に、コメントをもらうようなことがあります。
それを、社員別にコメントを集計したいケースが出てきました。

残念ながら、Excelの標準関数ではできません。ということで少し考えて
スピル関数であるFilter関数と、TEXTJOIN関数を組み合わせることで実現できました。

対象データ

# A B C
1 001 佐藤 foo
2 002 鈴木 bar
3 003 田中 baz
4 002 鈴木 qux
5 003 田中 quux

実現方法

TEXTJOIN関数と、FILTER関数を組み合わせて実現します。
TEXTJOIN関数は、指定された配列を、指定された区切り文字で連結します。
FILTER関数は、指定された条件に一致するセルを配列で返却します。

# F G
1 佐藤 =TEXTJOIN(", ",TRUE,FILTER(C1:C5,B1:B5=F1,""))
2 鈴木 =TEXTJOIN(", ",TRUE,FILTER(C2:C6,B2:B6=F2,""))
3 田中 =TEXTJOIN(", ",TRUE,FILTER(C3:C7,B3:B7=F3,""))

組み合わせるといい感じ。こんな実行結果になります。
image.png

参考

1
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
1
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?