2
2

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 5 years have passed since last update.

エクセルで指定した文字列が含まれるかどうかを判断する

Posted at

●概要●
数値の場合、指定した条件を満たすかどうかはIF関数だけで簡単に求めることができますが、文字列の場合、「○○という文字列を含む場合は~」といったようなあいまいな条件指定がIF関数だけではできません。これは、条件の指定にワイルドカードを使えないからなのですが、COUNTIF関数を組み合わせることにより、あいまいな条件指定が可能になります。

●詳細●

結果を表示するセルを選択します。
選択したセルに、数式 =IF(COUNTIF(範囲,条件),真の場合,偽の場合) を入力します。 (例)セルA1に「Excel」という文字列が含まれている場合は「○」を表示し、そうでない場合は空白にする場合、 =IF(COUNTIF(A1,"Excel"),"○","") と入力。
数式を入力したセルに判断結果が表示されます。
●補足●

文字列の全角半角、大文字小文字も区別されるため、条件を指定するときは注意してください。

2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?