Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Working with CSV and Excel Files ยท Lesson 7 of 9

Module Six

๐Ÿ“– Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
7
Module 6: Cleaning and Managing CSV and Excel Data

Module 6: Cleaning and Managing CSV and Excel Data

6.1 What You Will Learn

At the end of this module, you should be able to:

  • Explain what data cleaning means.
  • Identify incorrect and missing information.
  • Find and remove duplicate records.
  • Correct spelling mistakes and inconsistent formatting.
  • Identify common CSV file problems.
  • Prepare spreadsheet data for analysis.

6.2 What Is Data Cleaning?

Data cleaning is the process of finding and correcting mistakes, removing unnecessary information and fixing problems in a dataset.

Imagine your teacher gives you a list of 50 students. Some names appear twice, some students have no examination scores, and some names are misspelled.

If you use this information without correcting the mistakes, your results may be wrong.

Data cleaning helps you make information accurate, complete and ready for use.

Example of Unclean Data

Name Age Score
David 13 85
Mary 12 90
David 13 85
John 13
grace 12 95

Can you identify the problems?

  • David appears twice.
  • John's examination score is missing.
  • Grace's name begins with a small letter while other names begin with capital letters.

These are examples of data quality problems that should be checked before analysing the information.

6.3 Why Is Data Cleaning Important?

Data cleaning is important because incorrect information can lead to incorrect decisions.

Here are some reasons why we clean data:

  • Improves accuracy: Helps correct wrong information.
  • Removes duplication: Prevents the same record from being counted more than once.
  • Improves organisation: Makes information easier to read and understand.
  • Saves time: Reduces problems during data analysis.
  • Supports better decisions: Helps people make decisions using more reliable information.

6.4 Understanding Missing Data

Missing data occurs when important information is not available in a particular cell or record.

For example, a student record may contain a name and age but no examination score.

Example

Student Age Score
David 13 85
Mary 12 90
John 13
Grace 12 95

John's score is missing. Before using this information, you should find out why the score is missing.

How Can Missing Data Be Handled?

  • Check the original record to find the correct information.
  • Ask the person responsible for the information if necessary.
  • Leave the cell blank if the information is genuinely unavailable.
  • Use a clear label such as Not Available when appropriate.
  • Remove a record only when there is a valid reason and it is safe to do so.

Important: Never invent information to fill an empty cell. A guess can make your data inaccurate.

6.5 Finding and Removing Duplicate Records

A duplicate record is information that appears more than once when it should only appear once.

Imagine a shop owner records the same customer's payment twice. If both records are counted, the shop may believe the customer paid more money than they actually did.

Example of Duplicate Records

Customer Product Amount (โ‚ฆ)
Samuel Rice 5000
Esther Beans 3500
Samuel Rice 5000

The first and third records look exactly the same. If the third record was entered by mistake, it is a duplicate.

How to Remove Duplicates in Microsoft Excel

  1. Open your spreadsheet.
  2. Select the data table.
  3. Go to the Data tab.
  4. Click Remove Duplicates.
  5. Select the columns Excel should check.
  6. Click OK.
  7. Excel will report how many duplicate values were removed.

Important: Two records with the same name are not always duplicates. For example, two different students may be named David. Check the relevant details before deleting any record.

6.6 Correcting Spelling Mistakes and Inconsistent Text

Sometimes, the same information may be entered in different ways. This is called inconsistent data.

Example

Original Information Corrected Information
ibadan Ibadan
LAGOS Lagos
computer studies Computer Studies
Mathematic Mathematics

Notice that the corrected information follows a consistent style.

How to Correct Information

  1. Find the cell containing the incorrect information.
  2. Click the cell.
  3. Correct the spelling or formatting.
  4. Press Enter to save the change.
  5. Check other records for similar mistakes.

6.7 Removing Unwanted Spaces

Sometimes, people accidentally add spaces before or after names and other information.

For example:

  • Correct: David
  • Incorrect:   David
  • Incorrect: David  

These unwanted spaces can cause problems when sorting, comparing or searching for information.

In Excel, you can use the TRIM function to remove unnecessary spaces from text.

Example of the TRIM Function

=TRIM(A2)

If cell A2 contains a name with extra spaces, the TRIM function returns a cleaner version of the text.

6.8 Understanding Common CSV Formatting Problems

CSV files are simple, but sometimes their information may not appear correctly when opened in spreadsheet applications.

Here are some common problems:

  • Everything appears in one column: The application may not recognise the comma separator.
  • Strange symbols appear: The file may have an encoding problem.
  • Leading zeros disappear: Numbers such as 00125 may be treated as ordinary numbers.
  • Dates change format: The spreadsheet may interpret dates using different regional settings.
  • Information appears in the wrong columns: The file may contain unexpected separators or incorrectly formatted text.

Example: Leading Zeros

Imagine a student has an identification number of 00125. If Excel treats it as an ordinary number, it may display 125 instead.

This can be a problem because 00125 and 125 may represent different identification numbers.

To prevent this, import the column as text when appropriate or format the cells as Text before entering the information.

6.9 Checking Data Before Analysis

Before analysing a spreadsheet, it is important to check that the information is complete and correctly organised.

Use this simple checklist:

  • Are the column headings clear?
  • Are there spelling mistakes?
  • Are any important values missing?
  • Are there duplicate records?
  • Are dates and numbers displayed correctly?
  • Are names and descriptions written consistently?
  • Are all records arranged in the correct columns?

6.10 Practical Activity: Cleaning a Student Records File

Imagine your school administrator gives you the following student records. Your task is to identify the mistakes and prepare the information for analysis.

Unclean Student Records

Name Age Class Score
David 13 JSS2 85
Mary 12 JSS1 90
David 13 JSS2 85
john 13 JSS2
Grace 12 JSS1 95

Complete the following tasks using Microsoft Excel or Google Sheets:

  1. Create a spreadsheet and enter the student records.
  2. Identify the duplicate record.
  3. Check the missing examination score.
  4. Correct the name john to John.
  5. Investigate the missing score instead of guessing it.
  6. Remove the duplicate only after confirming it is an accidental repeat.
  7. Check that all information is in the correct columns.
  8. Save the cleaned file as Clean Student Records.xlsx.

6.11 Best Practices for Managing Data

  • Always keep an original copy of important data before making changes.
  • Use clear column headings.
  • Do not guess missing information.
  • Check records before removing duplicates.
  • Use consistent formats for dates, numbers and names.
  • Save your work regularly.
  • Protect private information and share files only with authorised people.

6.12 Important Terms to Remember

  • Data Cleaning: Finding and correcting problems in a dataset.
  • Missing Data: Information that is not available in a record.
  • Duplicate Record: A record that appears more than once when it should not.
  • Inconsistent Data: Information entered using different formats or styles.
  • TRIM: An Excel function used to remove unnecessary spaces from text.
  • Data Quality: How accurate, complete and consistent information is.
  • Dataset: A collection of related information.

6.13 Module Summary

In this module, you learned that data cleaning is an important part of working with CSV and Excel files. You discovered how to identify missing information, remove accidental duplicates, correct spelling mistakes and fix inconsistent formatting.

You also learned how to identify common CSV problems and check the quality of your data before performing analysis.

Knowledge Check

  1. What is data cleaning?
  2. Why is data cleaning important?
  3. What is missing data?
  4. What is a duplicate record?
  5. Which Excel function can remove unnecessary spaces from text?
  6. Why should you check records before removing duplicates?
  7. What can happen when a CSV file is not separated correctly?
  8. Why should you keep an original copy of important data?
  9. What should you do when an examination score is missing?
  10. What does data quality mean?

Coming Up in Module 7

In the next module, you will learn how to use basic formulas and data operations in Excel. You will discover how to calculate totals, averages, counts, minimum values and maximum values using simple spreadsheet formulas.

๐Ÿ† Get Certified

๐Ÿ”’

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (โ‚ฆ2,000 or 20,000 coins), and get a verified certificate with your name on it.

๐ŸŽ“ Sign Up to Get Certified
๐Ÿ› ๏ธ Practice Tools
Hands-on simulators & labs - subscription required.
โ†’
๐ŸŽฏ Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
โ†’