Office
 Computer >> コンピューター >  >> ソフトウェア >> Office

Excel での 19 の実践的なデータ クリーニング テクニック

データ入力と整理により、Microsoft Excel は初心者から中級者レベルのデータ分析も簡単に実行できます。私たちの日常的な使用のために、それは長い道のりを行く機能的なツールを提供することができます.データクリーニングは、あらゆるデータ分析方法の主要なステップです。これには、不要または不規則な値の削除、準備、または使用可能な値への変換が含まれます。このチュートリアルでは、さまざまなデータ クリーニング手法と、Microsoft Excel でそれらを実行する方法について説明します。

デモンストレーションに使用するワークブックは、以下のリンクからダウンロードできます。

便利な Excel の 19 のデータ クリーニング テクニック

この記事では、Excel での合計 19 の異なるデータ クリーニング手法について説明します。それらはすべて、多かれ少なかれさまざまな場合に重要です。それぞれがどのように機能するかを確認するか、上記の目次から必要なものを見つけてください。

1.重複行を削除

理由が何であれ、データに重複する行が含まれる場合があります。ほとんどの場合、重複行を排除する必要があります。昔は、重複データの削除は手作業で行われていましたが、削除作業は高度な技術で行うことができました。ただし、重複を削除 コマンドを使用すると、重複を簡単に削除できます。 重複を削除 コマンドは Excel 2007 で導入されました。

Excel での 19 の実践的なデータ クリーニング テクニック

横の列を複製してから、後で比較するために重複を削除しましょう。

Excel での 19 の実践的なデータ クリーニング テクニック

重複を削除するには、次の手順に従います。

手順:

  • まず、重複を削除する列を選択します。
  • [データ] に移動します
  • 次に、[重複を削除] を選択します データ ツールから そこにグループ化してください。

Excel での 19 の実践的なデータ クリーニング テクニック

  • その後、[現在の選択を続ける] を選択します。 ポップアップ ボックスでオプションを選択し、[重複を削除] をクリックします。 .

Excel での 19 の実践的なデータ クリーニング テクニック

  • 次に、[OK] をクリックします。 .

Excel での 19 の実践的なデータ クリーニング テクニック

これにより、選択からすべての重複が削除されます。

Excel での 19 の実践的なデータ クリーニング テクニック

2.重複値をハイライト

重複する値を完全に削除する代わりに、それらを強調表示すると役立つ場合があります。ここでは、重複する値を強調表示するさまざまなシナリオと方法を示します。

条件付き書式の利用

最初の部分では、 条件付き書式 を使用します 重複値を強調表示する機能。次のデータセットでそれを行います。

Excel での 19 の実践的なデータ クリーニング テクニック

次の手順に従って、その方法を確認してください。

手順:

  • まず、複製するセルを選択します。この場合、D5:D18 です。
  • 次に、ホームに移動します> 条件付き書式を選択> ハイライト セル ルールに移動> [重複する値] を選択します .

Excel での 19 の実践的なデータ クリーニング テクニック

  • 最終的に、重複する値 ウィンドウが表示されます。
  • 3 番目に、[複製] を選択します .
  • 4 番目に、次の値で色のオプションを選択します この例では、薄い赤の塗りつぶしに濃い赤のテキストを選択しています .

Excel での 19 の実践的なデータ クリーニング テクニック

  • その結果、D の値が重複していることがわかります 列が強調表示されます。

Excel での 19 の実践的なデータ クリーニング テクニック

最初のオカレンスを含む重複の強調表示

ここで、同じデータセットについて、最初に出現した値を含む重複値を強調表示します。これは前に述べたものと同じです。ただし、ここでは、COUNITF 機能とともに別のルートをたどります。 .この方法がどのように機能するかを確認するには、次の手順に従ってください。

手順:

  • まず、新しいフォーマット ルールに移動します 条件付き書式に移動して、ウィンドウ

Excel での 19 の実践的なデータ クリーニング テクニック

  • 次に、[数式を使​​用して書式設定するセルを決定する] を選択します .
  • 次に、式ボックスに次の式を書きます。

=COUNTIF($D$5:$E$16,$D5)>1

Excel での 19 の実践的なデータ クリーニング テクニック

  • したがって、D 最初の出現を含む重複の列が強調表示されます。

Excel での 19 の実践的なデータ クリーニング テクニック

最初の出現を除く重複の強調表示

ここで、重複する値を識別するための最も有用な手法の 1 つについて説明します。最初に出現したものを除いて強調表示されません。これは、すべての重複値ではなく、繰り返し値のみを観察したい場合に役立ちます。前と同じように、COUNTIF 関数を利用します。

次の手順に従って、その方法を確認してください。

手順:

  • これを行うには、まず 新しいフォーマット ルール に移動します 条件付き書式を通じて 前に説明したオプション

Excel での 19 の実践的なデータ クリーニング テクニック

  • 次に、[数式を使​​用して書式設定するセルを決定する] を選択します 以前と同じ方法で。
  • 次に、式ボックスに次の式を書きます。

=COUNTIF($D$5:$D5,$D5)>1

Excel での 19 の実践的なデータ クリーニング テクニック

  • [OK] をクリックした後 、最初の出現を除くすべての重複を強調表示します。

Excel での 19 の実践的なデータ クリーニング テクニック

3.テキストを複数のセルに分割

別のソースからデータをインポートすると、複数の値が 1 つの列にインポートされることがあります。次の図は、このタイプの輸入インシデントの例を示しています。

Excel での 19 の実践的なデータ クリーニング テクニック

便利な Text to Column があります これらのテキストを分割するのに役立つ機能です。

手順:

  • まず、テキストを分割する範囲を選択します。
  • 次に データ に移動します
  • その後、データ ツールから グループで、[テキストから列へ] を選択します .

Excel での 19 の実践的なデータ クリーニング テクニック

  • 次に、区切りを選択します 次のボックスに

Excel での 19 の実践的なデータ クリーニング テクニック

  • 次へをクリックした後 、別のボックスが表示されます。
  • スペースを選択 ここ 区切り記号 の下 テキストがスペースで区切られているため、オプション
  • [次へ] をクリックします .

Excel での 19 の実践的なデータ クリーニング テクニック

  • その後、[完了] をクリックします。 .

Excel での 19 の実践的なデータ クリーニング テクニック

  • 最後に、テキストが分割されます。

Excel での 19 の実践的なデータ クリーニング テクニック

  • では、見栄えを良くするためにいくつかの変更を加えてみましょう。

Excel での 19 の実践的なデータ クリーニング テクニック

これは、Excel の他のデータ クリーニング手法と共に、テキストを異なるセルに分割する方法です。

4.数式によるデータの変換

場合によっては、テキストの大文字と小文字を同じにしたい場合があります。 Excel では、テキストの大文字と小文字を直接変更する方法は提供されていませんが、数式を使用して簡単に変更できます。テキストを変更する 3 つの式は次のとおりです。

アッパー :この数式は、テキストをすべて大文字に変換します。

低い :この数式はテキストをすべて小文字に変換します。

適切 :これは、テキストを適切なケースに変換します (適切な名前のように、各単語の最初の文字が大文字になります)。

すべてのプレゼンテーションに次のデータセットを使用します。

Excel での 19 の実践的なデータ クリーニング テクニック

大文字への変更

前述のように、UPPER 関数を使用します この目的のために。次の手順に従って、その方法を確認してください。

手順:

  • まず、セル C5 を選択します .
  • 次に、次の式を書き留めてください。

=UPPER(B5)

Excel での 19 の実践的なデータ クリーニング テクニック

  • その後、Enter を押します .

Excel での 19 の実践的なデータ クリーニング テクニック

  • もう一度セルを選択し、フィル ハンドル アイコンをクリックしてドラッグし、残りのセルに数式を入力します。

Excel での 19 の実践的なデータ クリーニング テクニック

小文字への変更

次に、すべてのテキストを小文字に変換する方法を示します。

これについては、次の手順に従います。

手順:

  • まず、セル D5 を選択します .
  • 次に、次の式を書き留めてください。

=LOWER(B5)

Excel での 19 の実践的なデータ クリーニング テクニック

  • その後、Enter を押します .

Excel での 19 の実践的なデータ クリーニング テクニック

  • もう一度セルを選択し、フィル ハンドル アイコンをクリックしてドラッグし、残りのセルに数式を入力します。

Excel での 19 の実践的なデータ クリーニング テクニック

適切な大文字小文字への変更

適切な大文字と小文字は、適切な場所では大文字を示し、その他の場所では小文字を示します。このデータセットでは、次の方法を使用しています。

手順:

  • まず、セル E5 を選択します .
  • 次に、次の式を書き留めてください。

=PROPER(B5)

  • その後、Enter を押します .

Excel での 19 の実践的なデータ クリーニング テクニック

  • 最後に、もう一度セルを選択し、フィル ハンドル アイコンをクリックしてドラッグし、残りのセルに入力します。

Excel での 19 の実践的なデータ クリーニング テクニック

5.余分なスペースを削除

テキストに余分なスペースがないようにすることは、常に非常に重要な問題です。テキスト文字列の末尾にある空白文字を見つけることはできません。余分なスペースは、特にテキスト文字列を比較する必要がある場合に、多くの問題を引き起こします。たとえば、「7 月」は「7 月」と同じではありません。最初のものは 4 文字の長さで、2 番目のものは 5 文字の長さです。

これら 2 つのデータ クリーニング テクニックを Excel で使用して、余分なスペースを削除できます。

次のデータセットでは両方を使用します。

Excel での 19 の実践的なデータ クリーニング テクニック

TRIM 機能の使用

TRIM 機能を使用します テキストから先頭と末尾のスペースをすべて削除します。 トリム 関数はまた、複数のスペースを 1 つのスペースに置き換えます。

手順:

  • まず、Updated Data という名前の列を追加します 結果を表示します。
  • 次にセル D5 をクリックします .
  • 「=TRIM」と入力し、セル C5 を選択します 最初の引数で。かっこを閉じます。
  • 式は次のようになります:

=TRIM(C5)

  • では、Enter を押してください .

Excel での 19 の実践的なデータ クリーニング テクニック

  • Fill Handel アイコンを最後のセルにドラッグします。

Excel での 19 の実践的なデータ クリーニング テクニック

不要なスペースが削除されていることがわかります。各単語の後にはスペースが 1 つだけ存在します。

検索と置換機能の使用:

このセクションでは、検索と置換コマンドを使用してすべてのスペースを削除する方法について説明します。

手順:

  • まず、余分なスペースを削除するデータを選択します。
  • 次にホームに移動します タブ
  • 編集より コマンド、検索と選択 に移動します
  • [置換] を選択します ドロップダウン リストから

Excel での 19 の実践的なデータ クリーニング テクニック

  • [置換] を選択した場合 、ダイアログ ボックスが表示されます。
  • 検索対象に空白を入力します フィールド。
  • 置換を維持 箱は空です。
  • 次に、[すべて置換] をクリックします。 .

Excel での 19 の実践的なデータ クリーニング テクニック

  • [すべて置換] をクリックした後 、置換の数を示すポップアップが表示されます。
  • [OK ] をクリックします。
  • 次に [閉じる] をクリックします。 ダイアログ ボックスの。
  • ついに結果が出ました。

Excel での 19 の実践的なデータ クリーニング テクニック

6.奇妙な文字を削除

多くの場合、データを Excel ワークシートにインポートした後、奇妙な (場合によっては印刷できない) 文字が表示されることがあります。 CLEAN 関数を使用できます テキストからすべての非印刷文字を削除します。データがセル A2 にある場合、 あなたはあなたの仕事をするために使うことができます:

=CLEAN(A2)

クリーン 関数は、印刷されない Unicode 文字を見逃すことがあります。 7 ビット ASCII コードの最初の 32 個の非印刷文字を削除するようにプログラムされています。非印刷 Unicode 文字を削除する方法については、Excel ヘルプ システムを参照してください。

7.値を変換

データ クリーニング手法のもう 1 つの重要な点は、データセット内の値を別の値に変換することです。あるメートル法から別のメートル法に値を変換する必要がある場合があります。たとえば、値が液量オンス (fl oz) であるファイルをインポートする場合、値をミリリットルで表す必要があります。 Excel の CONVERT 関数 このタイプと他の多くのタイプの変換を実行できます。

この機能は非常に便利で、次のカテゴリの最も一般的な測定単位を処理できます:重量と質量、距離、時間、圧力、力、エネルギー、電力、磁気、温度、体積、液体、面積、ビットとバイト、速度.

デモンストレーションとして、データセットを見て、これを適用してみましょう。これがデータセットです。

Excel での 19 の実践的なデータ クリーニング テクニック

以下の手順に従って、温度を華氏に変更してください。

手順:

  • まず、出力セル D5 を選択します
  • 次に、次の式を入力します

=CONVERT(C5,"C","F")

  • その後、Enter を押します .

Excel での 19 の実践的なデータ クリーニング テクニック

  • フィル ハンドル アイコンをクリックして列の最後までドラッグし、すべての値を変換します。

Excel での 19 の実践的なデータ クリーニング テクニック

これは、値を他の単位に変換する方法です。その他の単位換算については、こちらの記事をご覧ください .

8.エラーをハイライト

適切な数式、文字列、または値がないため、スプレッドシートにエラーが表示されます。一つ一つ探すと結構時間がかかります。以下に、エラーを見つけて強調表示して簡単に見つけられるようにするための簡単なテクニックを説明しました。

一部のセルにエラーがあるデータセットがあるとします。次に、条件付き書式と スペシャルに移動 でそれらを強調表示します

次のスプレッドシートを見てみましょう。

Excel での 19 の実践的なデータ クリーニング テクニック

次の手順に従って、ここでエラーをハイライトしてください。

手順:

  • まず、データセット全体を選択して [新しいルール] をクリックします。 条件付き書式から オプション。

Excel での 19 の実践的なデータ クリーニング テクニック

  • 次に、ルール タイプで [次を含むセルのみをフォーマット] を選択します。 [エラー] を選択します 以下のドロップダウンリストから。

Excel での 19 の実践的なデータ クリーニング テクニック

  • 次にOKをクリックします .

これがデータセットの最終結果です。ご覧のとおり、Excel はエラー値を強調表示しています。

Excel での 19 の実践的なデータ クリーニング テクニック

これは、Excel のデータ クリーニング手法の 1 つとして、エラーを強調表示する方法です。

9.列を結合

列の結合は、データをクリーニングまたは再配置する際に時間がかかる可能性のある手法の 1 つです。このデモでは、次のデータセットを使用しましょう。

Excel での 19 の実践的なデータ クリーニング テクニック

次の手順に従って、Excel の個々のセルからこれらのテキストを結合する方法を確認してください。

手順:

  • まず、セル E5 を選択します .
  • 次の式を書き留めてください。

=B5&" "&D5&" "&C5

  • その後、Enter を押します .

Excel での 19 の実践的なデータ クリーニング テクニック

  • フィル ハンドル アイコンをクリックして列の最後までドラッグし、残りのセルの数式を複製します。

Excel での 19 の実践的なデータ クリーニング テクニック

これは、Excel で 2 つ以上の列を結合する方法です。

10.列を並べ替える

ワークシートの列を再配置する必要がある場合があります。少し考えてみれば、この問題は次の方法で解決できます。空白の列を作成し、別の列を新しい空白の列にドラッグできます。列を移動すると隙間ができるため、作業が完了したらその列を削除する必要があります。

次のデータセットで行っている、列を簡単に再配置するための簡単な方法を次に示します。

Excel での 19 の実践的なデータ クリーニング テクニック

手順:

  • まず、列ヘッダーをクリックして、移動する列を選択します。
  • 次に、コンテキスト メニューを使用するか、Ctrl+X を押して列を切り取ります .この時点で、選択範囲の境界に点線が表示されます。

Excel での 19 の実践的なデータ クリーニング テクニック

  • その後、前の列を配置する前の列ヘッダーを右クリックします。
  • [カット セルの挿入] を選択します。 コンテキスト メニューから。

Excel での 19 の実践的なデータ クリーニング テクニック

  • 前の列がここに挿入されます。

Excel での 19 の実践的なデータ クリーニング テクニック

これは、Excel のデータ クリーニング テクニックの一部として列を再配置する方法です。

11.行をランダム化

このセクションでは、行のランダム化について説明します。ほとんどの場合特に有用ではありませんが、データセットを再配置したい場合には便利なトリックです。または、Excel でリストの順序を変更したい場合。

次のデータセットに対してこのようなタスクを実行します。

Excel での 19 の実践的なデータ クリーニング テクニック

行をランダム化し、Excel で順序を変更するには、次の手順に従います。

手順:

  • まず、列 B の後に新しい列を作成する必要があります .このためには、列 C のヘッダー文字をクリックします 、および C 全体 列が選択されます。
  • 次に、右クリックして [挿入] コマンドを選択すると、新しい列が作成されます。

Excel での 19 の実践的なデータ クリーニング テクニック

  • 次に、新しく作成された列に名前を割り当てます (乱数など)。最初のセル (つまり C5) 列を選択し、次の式をセルに入力します。

=RAND()

  • その後、ENTER を押します 、セル C5 に乱数が表示されます .数が 1 未満です。

Excel での 19 の実践的なデータ クリーニング テクニック

  • 次に、セルをもう一度選択し、フィル ハンドル アイコンをクリックして列の末尾までドラッグし、残りのセルの式を複製します。

Excel での 19 の実践的なデータ クリーニング テクニック

  • セル C5 の間 ホームに移動します タブ
  • 次に 編集 に移動します グループ化して [並べ替えとフィルタ] をクリックします .
  • 最小から最大への並べ替えを選択します ドロップダウン メニューから

Excel での 19 の実践的なデータ クリーニング テクニック

  • コマンドをクリックするとすぐに、行がランダム化されます。列 C だけでなく、 、ただし、すべての列も行に沿ってランダムに変更されています.

Excel での 19 の実践的なデータ クリーニング テクニック

これらは、複数の列を持つデータセットを取得し、行に沿ったすべての列が値をランダム化するように行をランダム化する場合に従うことができる手順です。

12. URL からファイル名を抽出

URL のリストがあり、ファイル名だけを抽出する必要がある場合があります。次の方法で、URL からファイル名を抽出できます。セル B5 を想定 次の URL が含まれています:https://example.com/assets/images/horse.jpg .

ここでは、大量の関数からなる式が必要になります。心配しないでください。仕組みを理解するために後で追加された説明があります。この数式には RIGHT が含まれています 、レン検索 and SUBSTITUTE functions in it.

Now follow these steps to extract the file name (horse.jpg) from the link.

Steps:

  • First, select the cell where you want to put the file name. In this case, it is cell C5 .
  • Then write down the following formula in it.

=RIGHT(B5,LEN(B5)-FIND("*",SUBSTITUTE(B5,"/","*",LEN(B5)-LEN(SUBSTITUTE(B5,"/","")))))

Excel での 19 の実践的なデータ クリーニング テクニック

  • After that, press Enter .

Excel での 19 の実践的なデータ クリーニング テクニック

🔎 Breakdown of the Formula

👉 SUBSTITUTE(B5,”/”,””) removes all the “/” from the URL. It returns http:www.example.comassetsimageshorse.jpg.

👉 LEN(SUBSTITUTE(B5,”/”,””)) returns the length of the previous string.

👉 LEN(B5) returns the length of the string in cell B4 which is 46 here.

👉 LEN(B5)-LEN(SUBSTITUTE(B5,”/”,””))) indicates the difference between the two length values. This in turn indicates the number of “/” were removed.

👉 SUBSTITUTE(B5,”/”,”*”,LEN(B5)-LEN(SUBSTITUTE(B5,”/”,””))) substitutes all the slashes (/) is cell B5 with star sign (*) with the instance number from the result of the previous function.

👉 FIND(“*”,SUBSTITUTE(B5,”/”,”*”,LEN(B5)-LEN(SUBSTITUTE(B5,”/”,””)))) finds the position “*” is in the string up until now.

👉 LEN(B5)-FIND(“*”,SUBSTITUTE(B5,”/”,”*”,LEN(B5)-LEN(SUBSTITUTE(B5,”/”,””)))) is the difference between the original string length and the previous position.

👉 Finally, RIGHT(B5,LEN(B5)-FIND(“*”,SUBSTITUTE(B5,”/”,”*”,LEN(B5)-LEN(SUBSTITUTE(B5,”/”,””))))) extracts that number of characters from the right side of the cell.

13. Match Text in List

Let’s take a look at the following figure. We are going to find out the persons who have resigned from the left side of our example. There is a list on the right side of the resigned numbers.

Excel での 19 の実践的なデータ クリーニング テクニック

The above one shows a simple example. The data is in the range B5:D133 . The goal is to identify the rows in the data zone which are appearing in the Resigned Members list, in column G . You can delete these unnecessary rows later. We are going to need a combination of the IF and COUNTIF functions for the purpose.

Follow these steps to see how we can achieve the resigned status in our dataset.

Steps:

  • First, select cell E5 .
  • Then write down the following formula.

=IF(COUNTIF($G$5:$G$25,C5),"Resigned","")

  • After that, press Enter .

Excel での 19 の実践的なデータ クリーニング テクニック

  • Now double-click the fill handle icon on the bottom-right corner of the cell border. You can also click and drag. But as the dataset is large, we are opting for the previous method.
  • Once you have done that, the spreadsheet will look like this.

Excel での 19 の実践的なデータ クリーニング テクニック

This is how we can match text as part of the data analysis techniques in Excel.

14. Change Vertical Data to Horizontal

Transposing or changing vertical to horizontal and vice versa in a dataset is another common one in data analysis. So we will be discussing changing vertical data to horizontal now in the series of data cleaning techniques in Excel.

For that, we will be using the following dataset.

Excel での 19 の実践的なデータ クリーニング テクニック

Using Paste Special Option

The easiest way to change a vertical column to a horizontal row is to use the Paste Special option of Excel. It also keeps the exact formatting while changing the vertical column. So, you don’t need to apply any formatting later. Let’s follow the steps below to see how we can use the Paste Special option to transpose the columns.

  • First of all, select the range that you want to change to horizontal rows. Here, we have selected the range B4:C10 .
  • Secondly, press Ctrl+C to copy the range.
  • Thirdly, select a cell where you want to paste the range horizontally. In our case, we have selected Cell B12 .

Excel での 19 の実践的なデータ クリーニング テクニック

This will change vertical columns into horizontal rows in the Excel spreadsheet.

Excel での 19 の実践的なデータ クリーニング テクニック

Using TRANSPOSE Function:

We can use some Excel Functions to convert a vertical column to a horizontal row. Here, we will use the TRANSPOSE function その目的のために。 The main advantage of using functions is that you will get dynamic updates in the horizontal rows if you change anything in the main dataset. But, the horizontal rows will not have the same formatting as the vertical columns. You need to add formatting after applying the method.

Let’s follow the steps below to learn more.

Steps:

  • First, select the cell where you want to place the formula.
  • Then write down the following formula in it.

=TRANSPOSE(B4:C10)

Excel での 19 の実践的なデータ クリーニング テクニック

  • Now press Enter .

Excel での 19 の実践的なデータ クリーニング テクニック

This is how we can change vertical data to horizontal using the TRANSPOSE function.

15. Fill Blank Cells

One of the most important data cleaning techniques in any form of data analysis is filling blank values, either with average in numeric cases or with values with the previous or later rows.

Sometimes we keep some blank cells to understand that they will be the first filled ones, have a look at our dataset to understand it. But sometimes it creates problems like while we are filtering or sorting data. So it’s better to fill them and there are easy ways to o it.

This is our dataset.

Excel での 19 の実践的なデータ クリーニング テクニック

We can fill them up using these two simple methods.

Using Fill Command

If your data is small, you can enter the missing cell values from above manually or by using this command. Follow these steps to see how you can do that.

  • Select Cell B6 .
  • Then go to the Home
  • From the Editing group, click on Fill and then Down .

Excel での 19 の実践的なデータ クリーニング テクニック

  • The dataset will look like this now.

Excel での 19 の実践的なデータ クリーニング テクニック

  • Now repeat the process for all the blank cells and fill out all the cells.

Excel での 19 の実践的なデータ クリーニング テクニック

This is one way to fill up blank cells in a dataset.

Using Keyboard Shortcut:

We can achieve the same result using a keyboard shortcut. The shortcut is Ctrl+D . You just have to select the blank cell and press the shortcut. It will fill the cell with the value from the previous cell in the same column. Follow these steps for a more detailed guide.

  • First, select cell B6 .
  • Then press Ctrl+D on your keyboard.

Excel での 19 の実践的なデータ クリーニング テクニック

  • Now selecting cell B9 and pressing Ctrl+D will yield the following result.

Excel での 19 の実践的なデータ クリーニング テクニック

  • Now fill out all the blank values by selecting them and pressing the shortcut.

Excel での 19 の実践的なデータ クリーニング テクニック

16. Check Spelling

When you use Microsoft Word Document or another word processor, you use its spell checker feature most of the time. Spelling mistakes in a text document are embarrassing. In Excel, spelling mistakes can also occur serious problems. Say, for example, if you tabulate data by month, a misspelled month name will make that a year has 13 months.

Here we have made a dataset for the demonstration.

Excel での 19 の実践的なデータ クリーニング テクニック

We are going to correct the range C5:C7 . Follow these steps to see how we can do that.

Steps:

  • First, select the range C5:C7 .
  • Then go to the Review tab and select Spelling from the Proofing You can also skip this step and press F7 on your keyboard.

Excel での 19 の実践的なデータ クリーニング テクニック

  • Now select the correct suggestion and click on Change to change the value of a particular cell. The errors come in the selection order here.

Excel での 19 の実践的なデータ クリーニング テクニック

  • This will change the first error in the dataset.

Excel での 19 の実践的なデータ クリーニング テクニック

  • Now repeat this process for all the errors and you will have correct spellings this way.

Excel での 19 の実践的なデータ クリーニング テクニック

17. Replace or Remove Text

Removing and replacing data, especially outliers is another important task in any data cleaning process. So as a part of our data cleaning techniques compilation, we are going to demonstrate replacing and removing text in Excel. We can do that using three methods.

For all of the methods, we are using the following dataset.

Excel での 19 の実践的なデータ クリーニング テクニック

Using Find &Replace Feature:

Excel has a direct feature that can help find, replace and remove certain values from another. Follow these steps to see how we can use this feature to remove or replace in Excel.

  • First, select the range which you want to modify. In this case, it is C5:C13 .
  • Then go to the Home
  • After that, select Find &Replace from the Editing group section.
  • Next, select Replace from the drop-down.

Excel での 19 の実践的なデータ クリーニング テクニック

  • Now, go to the Replace tab in the pop-up box.
  • Then insert the value you want to replace in the Find what field and the value you want to replace it with in the Replace with

Excel での 19 の実践的なデータ クリーニング テクニック

  • Finally, click Replace All to replace all of them in the dataset.

This will be the final product after removing all of the hyphens from the dataset.

Excel での 19 の実践的なデータ クリーニング テクニック

Utilizing Flash Fill:

Another feature we can use to replace or remove values while using data cleaning techniques is to utilize the flash fill feature. For the same dataset, follow these steps to see how that works.

  • First, write down the final product after removing or replacing the desired value in the first cell. We are replacing the second hyphen in the string with a colon.

Excel での 19 の実践的なデータ クリーニング テクニック

  • Now start writing the second one manually. As soon as you start writing Excel will recognize the pattern and start suggesting output for the rest.

Excel での 19 の実践的なデータ クリーニング テクニック

Note

If the suggestion doesn’t occur in the second entry, try it out manually. It sometimes suggests the output at the third or fourth entry if the pattern isn’t that obvious to Excel.

  • Now press Enter .

Excel での 19 の実践的なデータ クリーニング テクニック

Thus, you can replace or remove values using this handy feature of Excel while data cleaning.

Using SUBSTITUTE Function:

Another way we can replace a value, or remove them in Excel is to use the SUBSTITUTE function . This function takes three values- a string, the value to replace, and the value to replace it with. Follow these steps to see how we can use this function.

  • First, select cell C5 .
  • Then write down the following formula in it.

=SUBSTITUTE(B5,"-",":",2)

  • After that, press Enter .

Excel での 19 の実践的なデータ クリーニング テクニック

  • Finally, select the cell again and click and drag the fill handle icon to the end of the column to replicate the formula for the rest of the cells.

Excel での 19 の実践的なデータ クリーニング テクニック

18. Add Text to Cells

Adding text is not only common as one of the data cleaning techniques but also in general Excel operations. We can add text to cells in various ways. For demonstrations of those, we will use the following dataset.

Excel での 19 の実践的なデータ クリーニング テクニック

Now you can use one of the following methods to add text to cells.

Using Ampersand (&) Symbol:

The ampersand (&) symbol in a formula works as the string connector. It connects the previous and the following string it is in between. Follow these steps to see how we can easily add text to cells using this.

  • First of all, select cell C5 .
  • Secondly, put down the formula below.

=B5&".mp3"

  • Next, press Enter .

Excel での 19 の実践的なデータ クリーニング テクニック

  • Finally, click and drag the fill handle icon to the end of the column to replicate the formula for the rest of the cells.

Excel での 19 の実践的なデータ クリーニング テクニック

Applying Flash Fill Feature:

Follow these steps to add text using the flash fill feature easily in Excel.

  • First, write down the first intended value manually in cell C5 .

Excel での 19 の実践的なデータ クリーニング テクニック

  • Then start filling out the second one in the dataset. Once you start filling, Excel will suggest the pattern.

Excel での 19 の実践的なデータ クリーニング テクニック

  • As soon as the suggestion appears, press Enter .

Excel での 19 の実践的なデータ クリーニング テクニック

This is another way to add text in Excel.

Using CONCATENATE Function:

The CONCATENATE function in Excel, as the name suggests, concatenates two or more strings together. It takes those strings as its arguments. It works the same way as the ampersand sign method described earlier. Follow these steps to see how we can use this function.

  • First, select cell C5 .
  • Then write down the following formula in it.

=CONCATENATE(B5,".mp3")

  • After that, press Enter .

Excel での 19 の実践的なデータ クリーニング テクニック

  • Finally, select the cell again and click and drag the fill handle icon to the end of the column to replicate the formula for the rest of the cells.

Excel での 19 の実践的なデータ クリーニング テクニック

19. Fix Trailing Minus Sign

Sometimes while taking data from other sources, the negative values do have a trailing minus sign. Take a look at the following figure.

Excel での 19 の実践的なデータ クリーニング テクニック

Excel doesn’t consider the values with trailing negative signs as numbers. Instead, it treats them as texts. This may cause problems, not only in the data cleaning techniques but also in general operations like using formulas in Excel. So we need to address the problem and convert them into negative numbers.

Follow these simple steps to do that.

Steps:

  • First, select the range you want to convert. We have copied it to compare it with the previous one.

Excel での 19 の実践的なデータ クリーニング テクニック

  • Then go to the Data tab on your ribbon.
  • Then select Text to Columns from the Data Tools group section.

Excel での 19 の実践的なデータ クリーニング テクニック

  • Finally, directly click on Finish in the wizard.

Excel での 19 の実践的なデータ クリーニング テクニック

This will automatically change all the negative values with trailing minus signs to Excel’s negative sign format.

Excel での 19 の実践的なデータ クリーニング テクニック

This procedure works because there is a default setting in the Advanced Text Import Settings ダイアログ ボックス。

結論

So these were some of the most useful data cleaning techniques in Excel used for data analysis. Hopefully, you can use these techniques while using data cleaning in Excel with ease. I hope you found this guide helpful and informative. If you have any questions or suggestions, let us know in the comments below.

For more guides like this, visit Exceldemy.com .


  1. Excel で質的データを量的データに変換する方法

    このチュートリアルでは、質的データを変換する方法を示します Excel の定量データへ .質的研究が量的研究と異なると言うのは不正確です.研究者は定性的データよりも定量的な結果を好みます それはより科学的で、強烈で、客観的で、受け入れられるからです。ただし、研究者は定性的データと定量的データの組み合わせも使用します。この場合、ある種類のデータの強度が、別の種類のデータの制限と釣り合います。 ここから練習用ワークブックをダウンロードできます。 定性データを Excel で定量データに変換する 3 つの簡単な方法 この記事では 3 について説明します。 Excel で質的データを量的データに

  2. Excel にデータ分析をインストールする方法

    Microsoft Excel は、さまざまな種類のデータ分析に非常に広く使用されています。複雑な統計的または工学的分析を開発したい場合、時間と労力がかかります。しかし、Excel のデータ分析オプションを使用することで、問題を根絶することができます。 しかし、その機能を自然に使うことはできません。最初にインストールする必要があります。この記事では、Excel にデータ分析をインストールする方法を示します。 データ分析ツールパックとは データ分析ツールパック アドインです データ分析を有効にするために不可欠な Excel で . Data Analysis Toolpak をインストールする