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

数式で「もしかして」検索

Posted at

名前が一部旧体字になっている、苗字しかわからないなどの場合に「もしかして」検索できる数式。
SEQUENCE関数とEXACT関数を使って1文字ずつ検査する。

数式

パターン1:文字順一致

1文字目から照合し、2文字以上合っていれば「もしかして:」表示する

=byrow(C2:C,lambda(x,if(x="",, join(",",tocol(byrow(B2:B,lambda(y,if(y="",,let( range1,index(mid(y,SEQUENCE(1,len(y)),1)), range2,index(mid(x,SEQUENCE(1,len(x)),1)), if(sum(sum(makearray(COUNTA(range2),1,lambda(a,b, if(exact(iferror(index(range1,0,a)),index(range2,0,a)),1,0)))))>1,y,))))),true)))))

正:
誤:

パターン2:文字順不問

順番バラバラでも、2文字以上合っていれば「もしかして:」表示する

=byrow(C2:C,lambda(x,if(x="",, join(",",tocol(byrow(B2:B,lambda(y,if(y="",,let( range1,index(mid(y,SEQUENCE(1,len(y)),1)), range2,index(mid(x,SEQUENCE(1,len(x)),1)), if(sum(sum(makearray(COUNTA(range1),COUNTA(range2),lambda(a,b, if(exact(index(range1,0,a),index(range2,0,b)),1,0)))))>1,y,))))),true)))))

結果

B列に正しい名前を入力しておき、検査したい人をC列に並べると
2文字以上一致する氏名を「,」でつないで表示する。

image.png

注意

重いので検査人数は30人くらいまでにする

余談

記事書いていて知ったんですけど、キャラクターの名前って著作物に当たらないんですね。
創作物の中で人物を特定するための符号に過ぎないから創作的な著作物とは認めない、という判決があるらしいです。名前って設定くらい悩む創作性のあるものだと思うけど…。
鬼滅の刃大好きです!映画三回見ました!

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