IsText、IsNonText関数の引数に対象(セルなど)を指定することで、それが文字列かどうかを判別することができます。
IsText関数の使い方
対象が文字列ならTrue,そうでないならFalseを返す
IsText(対象)
IsText(対象)

IsText関数を使うと、対象が文字列かどうかでTrue、Falseを振り分けることができます。

=IsText(A2)と指定して、左隣のA2セルが文字列かどうかを判断します。

Enterを押すと、「ABC」は文字列なので、論理値Trueが返されました。

下までオートフィルしてみると、数字や日付に対してはFalseが返されることが確認できます。
IsNonText関数の使い方
対象が文字列以外ならTrue,文字列ならFalseを返す
IsNonText(対象)
IsNonText(対象)

IsNonText関数はIsText関数の逆です。
文字列以外の場合はTrueを、文字列の場合はFalseを返します。
文字列以外の場合はTrueを、文字列の場合はFalseを返します。

=IsNonText(A2)だと、「ABC」は文字列なのでFalseが返ります。

数値、日付などに対しては、文字列ではないのでTrueが返ります。

なお、空白の場合もTrueが返ります。
If関数との組み合わせ

If関数に組み込んで文字列かどうかで結果を分岐させる場合は、たとえば=If(IsText(A2),”文字列”,””)のように記述します。

やりたいことから方法を探すエクセル(Excel)操作・関数・VBA(マクロ)逆引きまとめ
逆引き(やりたいことから探す)Excel記事まとめ

関数・演算子・メソッド・プロパティ名から探すExcel/VBA(マクロ)使い方・組み合わせ方まとめ
こちらはExcelやメソッドの諸機能を、機能の名称から探せるまとめ記事です。
コメント