ワークブックのモジュールに次の関数を追加します。
Function allIn(str1, str2)
' check whether all elements of str1 occur in str2
' and vice versa
Dim l1, l2, ii As Integer
Dim isfound As Boolean
isfound = True
l1 = Len(str1)
l2 = Len(str2)
If l1 < l2 Then
' look for all the elements of str1 in str2
For ii = 1 To l1
If InStr(1, str2, Mid(str1, ii, 1), vbTextCompare) <= 0 Then
isfound = False
Exit For
End If
Next ii
Else
' look for all the elements of str2 in str1
For ii = 1 To l2
If InStr(1, str1, Mid(str2, ii, 1), vbTextCompare) <= 0 Then
isfound = False
Exit For
End If
Next ii
End If
allIn = isfound
End Function
これで、コード内の別の場所result = inStr("ABD", "BAD")
から、-を使用して、またはスプレッドシート自体からこれを呼び出すことができます。スプレッドシートで、セルと=allIn(A3, B6)
の文字列を比較するために入力します。A3
B6
これを行ったときに何が起こるかを示します(=allIn(A1, B1)
セルに入力しC1
、数式を次の4行にドラッグしました)。

私はそれがあなたの問題を解決すると信じています。
編集:あなたの質問に対する@Philipのコメントに気づきました-私がそれを作成し始めたとき私はそれを見ていませんでしたが、私は彼の提案を実行したようです...しかしここにすべて同じ帽子の先端があります!