Skip to Main Content

Data Cleaning with Excel

Through this guide you will learn tricks and tips to better clean and organize tabular data using Microsoft Excel.

Find & Replace

Building on work from the COUNTIF and Advanced Filter exercises, we can now use Find & Replace to replace the shorthand "C/O" with "complaining of" in the Narrative column. It is best to complete the Advanced Filter exercise first and leave the filter on; this has selected for us all the rows which use the "C/O" shorthand

Find & Replace instructions:

  • From the Home tab on the Ribbon, choose Find & Select (this feature is at the end of the Ribbon, with a magnifying glass icon)
  • Find a string (e.g., C/O) and replace it with the desired text (complaining of). Click Replace.
  • Using the Filter arrow still at the top of the Narrative_1 column, go back to Text Filters, then Custom Filter (or in Mac, Filters - Contains - C/O). The filter criteria you entered before should still be present. Click OK, and this filter will run again, taking out the rows that now meet the criteria due to the Find & Replace change
  • Repeat the above steps as many times as necessary to replace "C/O" in each row where it appears with "complaining of"
  • Alternatively, rather than replacing the "C/O" entries one at a time, click Replace All if you are sure that you want to replace all instances of the text string "C/O" anywhere it appears in any fields in the Narrative column. (This can be done if "C/O" was never used to denote anything other than "complaining of")

Screen image illustrating the use of the Find and Replace tool in Excel