Data Cleaning: Techniques, Tools and Practical Examples for Beginners (2027)
Data Cleaning: Techniques, Tools and Practical Examples for Beginners (2027)
Raw data rarely arrives ready for analysis. A sales spreadsheet might contain duplicate orders, a customer database could have missing email addresses, and a marketing report may record the same city in three different ways.
These issues can look minor when you view individual records. But when you calculate revenue, compare customer behaviour or build a dashboard, even a small data quality problem can produce misleading results.
Imagine preparing a monthly sales report for your manager. You create attractive charts, calculate growth percentages and identify the best-performing products. Everything looks professional, until someone discovers that cancelled orders were included in the revenue total and several transactions were counted twice.
The problem is not necessarily your analysis. It is the quality of the data you analysed.
Data cleaning is the process that helps you identify, investigate and correct data quality problems before they undermine your conclusions. It is one of the most important practical skills for aspiring data analysts, because real datasets are rarely as neat as the examples in a textbook.
In this guide, you will learn how data cleaning works, why different techniques are used, how to apply them in Excel, SQL and Python, and how companies such as Uber and Airbnb approach data quality challenges. You will also work through a realistic project that you can adapt for your portfolio. If you are just starting out, read our guide to data analysis for beginners first.
Table of Contents
Understanding Data Cleaning and Why It Matters
What Is Data Cleaning?
Data cleaning, sometimes called data cleansing, is the process of detecting and addressing inaccurate, incomplete, duplicated, inconsistent or otherwise unsuitable data. The aim is to make a dataset reliable enough for its intended use while preserving the meaning of the original information.
For example, consider the following customer records from a fictional online store.
Customer ID | Customer Name | City | Order Amount |
|---|---|---|---|
C101 | Aman Sharma | Amritsar | ₹1,500 |
C102 | Priya Verma | Ludhiana | ₹2,000 |
C103 | Aman Sharma | Amritsar | ₹1,500 |
C104 | Rahul Singh | AMRITSAR | ₹2,500 |
C105 | Neha Kaur | Chandigarh | Missing |
At first glance, this looks like a small, ordinary table. But several questions arise immediately:
Are the records for Aman two genuine purchases or one order entered twice?
Should AMRITSAR and Amritsar be treated as the same city?
Why is Neha's order amount missing?
Is the missing amount zero, unknown, or simply not entered?
Do the customer IDs uniquely identify customers, or individual transactions?
These are data quality questions. You cannot safely answer all of them by running an automatic cleaning command. Two identical orders may be legitimate if a customer bought the same product twice. A missing order amount should not automatically be replaced with zero, because that could understate revenue. A good data analyst investigates the meaning of the records before changing them.
Data Cleaning vs Data Transformation
These terms are related, but they are not the same. Data cleaning focuses on identifying and resolving quality problems, such as incorrect formats, duplicate records and invalid values. Data transformation changes the structure or representation of data so it can be analysed more effectively. Examples include converting dates into months, combining first and last names, calculating revenue from quantity and unit price, or converting sales amounts into a common currency.
Consider this record:
Quantity | Unit Price | Raw Date |
|---|---|---|
3 | ₹500 | 23/10/2026 |
Cleaning might involve verifying that the quantity is valid and the price is numeric. Transformation could calculate the line-item total: 3 × ₹500 = ₹1,500. You might also transform the date into a standard format that your reporting tool recognises. In practice, cleaning and transformation often happen together during data preparation.
What Is Data Quality?
Data quality describes how suitable data is for a particular purpose. A dataset is not automatically high quality just because it has many records or no blank cells. Several dimensions help you assess quality:
Accuracy: Does the information reflect reality?
Completeness: Are the required fields populated?
Consistency: Do values follow the same rules across records and systems?
Validity: Do values meet the expected format, range or business rule?
Uniqueness: Are records that should be unique actually unique?
Timeliness: Is the information available and up to date when it is needed?
Suppose a customer database contains 10,000 records, but 2,000 have outdated phone numbers. The database may be complete, because every phone-number field is filled, yet it is still inaccurate. Filling every blank does not necessarily improve data quality.
Why Is Data Cleaning Important in Data Analysis?
Data cleaning directly affects the conclusions you draw from a dataset. A calculation can be mathematically correct and still produce the wrong business answer if the underlying records are incorrect.
It prevents misleading business reports
Imagine a retailer reports ₹10 lakh in sales, but ₹1 lakh of that total comes from duplicated transactions. The report overstates sales by ₹1 lakh, or 10% of the reported total. Management might then make poor decisions about inventory, marketing budgets or sales targets. Removing confirmed duplicates and checking how cancellations and refunds are treated produces a more trustworthy report.
It improves the reliability of dashboards
Business intelligence tools such as Power BI display data clearly, but they do not know whether every source record is correct. Suppose a dashboard shows customer counts by city. If one city appears as “Amritsar”, “AMRITSAR” and “Amritsar ” (with an extra space at the end), the dashboard may show three separate categories instead of one. Standardising the values makes the report easier to read. Still, preserve genuinely different locations and investigate ambiguous names instead of merging them blindly.
It supports better machine learning and statistical analysis
A model trained on incorrect labels, duplicated observations or inconsistent measurements may learn misleading patterns. Missing values can shrink the usable sample or introduce bias if they are not missing at random. For example, imagine a model that estimates house prices, but some records accidentally contain monthly rent in the sale-price column. Unless those errors are found, the model receives contradictory examples of what a house price means. Cleaning alone does not guarantee a good model, but poor-quality input can undermine the whole modelling process.
It saves time during reporting and decision-making
Without a repeatable cleaning process, analysts may fix the same problems every time a report is updated. A documented workflow can standardise city names, validate dates, flag duplicates and report missing values consistently. This makes recurring work easier to maintain and helps other team members understand how the results were produced.
What Are the Common Data Quality Problems?
Before choosing a cleaning method, you need to recognise the problem in front of you. Different issues need different solutions.
Missing values
A missing value is a field with no recorded value. A customer record may have a name and city but no email address, or a sales transaction may have a quantity but no unit price. Values go missing because a field was optional, a data transfer failed, a customer did not provide the information, or a system recorded only part of a transaction. The correct response depends on the field and the purpose of the analysis.
Duplicate records
A duplicate record repeats another record in a way that is unintended for the dataset's definition. A common example is an order imported twice from the same source. However, two transactions from the same customer with identical amounts are not necessarily duplicates. Identify the right unique key, such as an order ID, a transaction ID or a combination of fields, before removing records.
Inconsistent values
Inconsistent values describe the same concept in different forms. Examples include:
Punjab, punjab and PUNJAB
Yes, Y and yes
Male, M and male
23/10/2026 and 2026-10-23
Some variations are only formatting differences. Others may carry different meanings and need investigation.
Incorrect data types and formats
A data type determines how a tool or programming language interprets a value. The number 1500 can be used in a calculation, while the text “1500” may not behave the same way in every operation. Dates are another common source of trouble: the string 04/05/2026 could mean 4 May or April 5, depending on the date convention. Before converting values, confirm the source format and the intended meaning.
Outliers and unusual values
An outlier is an observation that differs substantially from the others in a dataset. Suppose most orders in an online store are between ₹500 and ₹5,000, but one order is ₹5,00,000. That record deserves investigation. It might be a data-entry error, a bulk purchase or a legitimate high-value transaction. An unusual value is a reason to investigate, not an automatic reason to delete it.
Invalid values and broken business rules
A value may be technically valid but logically impossible for the task. A sales record with a quantity of -5 may be invalid if the table should contain only completed sales, but negative quantities may be legitimate in a table that records returns. Similarly, an employee record with an end date earlier than the start date may signal a problem, unless the fields have a special meaning in that system. Understanding business rules helps you separate true errors from valid exceptions.
What Is the Data Cleaning Process? Six Steps
A repeatable data cleaning process makes your work easier to explain, test and maintain.
Step 1: Understand the dataset
Before editing anything, establish what each row represents and what the columns mean. Is each row one order, one product, one customer or one event? Are the monetary values in rupees, dollars or another currency? Does a blank field mean unknown, not applicable or not yet collected? These details influence every cleaning decision that follows.
Step 2: Inspect the data
Review the number of rows and columns, field names, data types, missing values, unique values and basic statistics. In Excel, begin by filtering columns and checking summaries. In Python, inspect a DataFrame's structure and missing-value counts. In SQL, query row counts, distinct values and records that violate expected rules. The purpose is to understand the dataset before changing it.
Step 3: Define quality rules
Write down what the data should look like. For example:
Each order ID should be unique in an order-header table.
Quantity should be a positive integer for completed sales.
Order date should fall within a plausible business period.
Unit price should be numeric and expressed in a known currency.
Every product ID should match a product in the product table.
These rules turn vague expectations into checks you can test.
Step 4: Correct or flag problems
Apply suitable techniques to missing values, duplicates, inconsistent formats, invalid records and outliers. Some issues can be corrected automatically. Others need review by the person who owns the data or understands the business process. Keep a record of changes that could affect the results.
Step 5: Validate the cleaned dataset
After cleaning, check whether the dataset satisfies the quality rules. Compare row counts before and after, verify key totals, confirm that required fields are valid and check that relationships between tables still work. If revenue changes dramatically after cleaning, find out why. The change may be justified, or an important record may have been removed by mistake.
Step 6: Document and repeat the process
Document the source, assumptions, cleaning rules and unresolved issues. When the same report is generated every month, automate repeatable checks where appropriate. Keep the original source data unchanged when possible, and save the cleaned output separately or use a versioned pipeline. This creates a traceable process that another analyst can review and reproduce.
Data Cleaning Techniques, Tools and Practical Examples
The best way to understand data cleaning is to apply each technique to a realistic problem. The examples below use fictional student datasets. The numbers are for learning and are not company results.
How Do You Handle Missing Values?
Missing values are among the most common issues in data analysis. The challenge is deciding what the absence of a value means and how to handle it without introducing misleading information.
Identify why the value is missing
Suppose a sales table contains these records.
Order ID | Quantity | Unit Price | Total |
|---|---|---|---|
O101 | 2 | ₹500 | ₹1,000 |
O102 | 3 | ₹400 | ₹1,200 |
O103 | 2 | Missing | Missing |
O104 | 1 | ₹800 | ₹800 |
You cannot calculate Order O103's total because the unit price is unknown. You might be able to retrieve the correct price from the product catalogue or the original invoice, which is usually better than guessing. If the missing value cannot be recovered, you can flag the record, exclude it from a specific calculation when justified, or use a suitable imputation method for an appropriate analytical task.
Imputation means replacing a missing value with an estimated or substituted value. It should follow a reasoned method, not a wish to remove blanks.
Remove, replace or retain missing values?
There is no universal rule. Consider these approaches:
Remove records when appropriate. If a record is unusable for a particular analysis and only a small, well-understood part of the data is affected, removing it may be reasonable. But removing records can introduce bias if the missingness is systematic.
Use a justified replacement. For some numerical analyses, the median or another estimate may be suitable. A median is less sensitive to extreme values than a mean.
Retain the missing value. If the absence itself is meaningful or no reliable replacement exists, keeping the value missing may be more honest than inventing one.
Add a missingness indicator. In some analyses you can create a separate field that records whether the original value was missing. This helps you investigate whether missingness is related to other variables.
For instance, a marketing dataset might have missing customer ages because age was optional. Replacing every missing age with the average age creates the false impression that those customers actually have that age.
Practical example: handling missing values in Python
import pandas as pd
df = pd.read_csv("sales.csv")
# Count missing values in each column
print(df.isna().sum())
# Create a separate view of records with missing prices
missing_prices = df[df["UnitPrice"].isna()]
print(missing_prices)The first statement reports how many values are missing in each column. The second identifies records where the unit price is missing so you can investigate them. If the missing prices can be retrieved from an authoritative product table, join that information into the dataset. If they cannot, document how those rows will be treated in the intended analysis. Avoid automatically filling every numerical blank with zero. Zero is a real value, not a universal substitute for unknown information.
How Do You Remove Duplicate Records?
Duplicate handling requires understanding what makes a record unique.
Exact duplicates vs business duplicates
An exact duplicate repeats the same values across the relevant columns. A business duplicate occurs when two records represent the same real-world event, even if some fields differ. For example, the same order may appear twice because one import has a slightly different timestamp. The rows are not identical, but the order ID shows they refer to the same transaction.
On the other hand, a customer may place two orders for ₹1,500 on the same day. Removing one just because the amount and customer match would be incorrect.
Practical example: finding duplicate orders in Excel
Imagine an Excel table with columns for Order ID, Customer, Date and Amount. To investigate duplicates:
Make a copy of the original worksheet or preserve the original file.
Select the relevant data.
Use Excel's Data → Remove Duplicates feature only after deciding which columns define a duplicate.
Review the number of records removed.
Compare order counts and sales totals before and after the operation.
If the order ID is supposed to be unique, use it as the primary check. If you have no reliable unique identifier, investigate suspicious groups instead of deleting them automatically. Excel's Remove Duplicates removes records based on the columns you select. It does not decide whether two records are truly the same business event. To build these skills step by step, see our Basic Computer and MS Office course, which covers Excel from the basics.
Practical example: detecting duplicate IDs with SQL
SELECT
OrderID,
COUNT(*) AS RecordCount
FROM Orders
GROUP BY OrderID
HAVING COUNT(*) > 1;This query returns order IDs that appear more than once. It identifies potential duplicates, but it does not tell you which record to keep. You may need to inspect timestamps, status changes, source systems or transaction details before deciding how to resolve them.
Practical example: removing exact duplicates with Pandas
import pandas as pd
df = pd.read_csv("orders.csv")
print("Rows before:", len(df))
df_clean = df.drop_duplicates()
print("Rows after:", len(df_clean))This example removes rows that are identical across all columns. If your definition of a duplicate is based only on OrderID, the logic is different. Before using drop_duplicates(subset=["OrderID"]), confirm that each order should appear only once in the table and decide how to handle multiple legitimate versions of an order.
How Do You Correct Inconsistent Data?
Inconsistent values can make one category appear as several, producing incorrect summaries.
Standardise text and categories
Consider these values in a city column: Amritsar, AMRITSAR, amritsar and “Amritsar ” (with a trailing space). They may all refer to the same city. You can standardise the case and remove unnecessary leading or trailing spaces. In Python:
df["City"] = df["City"].str.strip().str.title()This removes surrounding whitespace and converts words to title case. However, title case alone cannot resolve every variation. Abbreviations, spelling errors, alternative names and genuinely different places may need a mapping table or a reference list. For a professional project, document the mapping rules you used.
Standardise Yes/No and other categorical values
A survey may record answers as Yes, YES, Y, No, NO and N. If all these variants have the same meaning, map them to a consistent set of values.
mapping = {
"YES": "Yes",
"Y": "Yes",
"NO": "No",
"N": "No"
}
df["Subscribed"] = (
df["Subscribed"]
.str.strip()
.str.upper()
.map(mapping)
.fillna(df["Subscribed"])
)This example normalises common responses while keeping values that do not match the mapping. In production, explicitly review any remaining values that fall outside the expected categories. Never assume that two labels are equivalent just because they look similar. Confirm their meanings first.
How Do You Find and Handle Outliers?
An outlier is a value that lies unusually far from the rest of the observations. Outliers can come from data-entry errors, measurement problems, unusual events or legitimate differences between observations.
Example: finding an unusual sales amount
Suppose the order amounts are ₹700, ₹800, ₹900, ₹1,000, ₹1,100 and ₹50,000. The ₹50,000 order is much larger than the others. But should you remove it? Not necessarily. It could be a bulk order or a legitimate purchase from a corporate customer. If it is genuine, removing it would understate revenue.
Instead, verify the order against the source record and decide whether it belongs in the analysis. If the order is valid but unusual, you may report results both with and without it when that comparison helps explain the distribution.
The interquartile range (IQR) method
The interquartile range measures the spread of the middle 50% of observations.
Q1 is the first quartile, or 25th percentile.
Q3 is the third quartile, or 75th percentile.
IQR = Q3 − Q1.
A common rule flags values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR as potential outliers. This is a screening rule, not proof that a value is incorrect. Results can depend on the dataset's distribution and the method used to calculate quartiles.
Practical example in Python
Q1 = df["OrderAmount"].quantile(0.25)
Q3 = df["OrderAmount"].quantile(0.75)
IQR = Q3 - Q1
lower_limit = Q1 - 1.5 * IQR
upper_limit = Q3 + 1.5 * IQR
potential_outliers = df[
(df["OrderAmount"] < lower_limit) |
(df["OrderAmount"] > upper_limit)
]
print(potential_outliers)This code identifies potential outliers in OrderAmount. It does not remove them. After reviewing the results, decide whether to correct a confirmed data-entry error, keep a valid unusual transaction, or apply a documented treatment suited to the analysis.
How Do You Standardise Data Types and Formats?
A dataset may contain values that look correct but are stored in formats that prevent reliable calculations.
Convert numbers stored as text
Suppose an imported sales file contains “1500” as text instead of the number 1500. Some tools may not calculate sums or averages correctly until the field is converted. Before converting, check for currency symbols, commas, spaces and other characters that may interfere with parsing.
In Excel, you can use Text to Columns, the warning icon for numbers stored as text, or a formula. The right method depends on how the source data is formatted. In Python, you can use:
df["Amount"] = pd.to_numeric(
df["Amount"],
errors="coerce"
)errors="coerce" converts values that cannot be parsed into missing values. This is useful for exposing invalid entries, but you must inspect the newly missing values and work out what went wrong.
Standardise dates
Dates are especially important when you analyse trends, compare months or calculate time intervals. The string 05/06/2026 can mean 5 June or May 6, depending on the convention used by the source. Before converting a date column, confirm its original format.
df["OrderDate"] = pd.to_datetime(
df["OrderDate"],
format="%d/%m/%Y",
errors="coerce"
)This example expects dates in day/month/year format. Values that do not match become missing, so you can investigate them. Once dates are parsed correctly, you can group orders by month, calculate the days between events and find records outside the expected reporting period.
How Do You Validate Data and Fix Incorrect Values?
Data validation checks whether records meet defined rules. It is an important part of cleaning, because a value can look reasonable while still violating the requirements of the dataset.
Apply range checks
Suppose a training institute records student attendance as a percentage. A value of 85 is plausible, but 850 may mean a decimal point was misplaced or the value was entered in a different unit. If attendance must be between 0 and 100, flag values outside that range for review. In Python:
invalid_attendance = df[
(df["Attendance"] < 0) |
(df["Attendance"] > 100)
]This identifies values outside the expected range. It does not tell you what the correct value should be.
Check relationships between fields
Some errors become visible only when you compare multiple columns. For example:
Order total should generally agree with quantity multiplied by unit price, after accounting for discounts and taxes.
An end date should normally not come before a start date.
A foreign key in one table should match a record in a related table.
A completed order should have the fields required by the business process.
These checks are especially useful when combining data from different systems.
Validate after cleaning
After correcting the data, rerun the checks and compare important totals. If you removed duplicates, check how many records remain. If you converted invalid dates, count how many became missing. If you standardised categories, confirm that unexpected values have not disappeared silently. This creates a feedback loop: identify the issue, apply the cleaning rule, and verify that the result meets the intended standard.
Which Tool Is Best for Data Cleaning: Excel, SQL or Python?
You do not need to learn every tool at once. Choose based on the dataset, your current skills and the analysis you need to perform.
Tool | Useful Cleaning Tasks | Best Starting Exercise |
|---|---|---|
Microsoft Excel | Removing duplicates, filtering, correcting formats, replacing values | Clean a small customer spreadsheet |
Power Query | Repeatable data preparation and combining files | Import and standardise multiple monthly sales files |
SQL | Finding duplicates, checking ranges, joining reference tables | Validate orders stored in a database |
Python with Pandas | Handling missing values, standardising columns, repeatable cleaning | Clean a CSV dataset and generate a quality report |
OpenRefine | Exploring and reconciling messy text categories | Standardise inconsistent names and labels |
Data cleaning in Excel
Excel is a useful starting point for beginners who need to inspect and correct a spreadsheet by hand. Common features include:
Remove Duplicates: finds and removes repeated rows based on selected columns.
Find and Replace: replaces known text variations.
Filters: help you isolate blanks, unexpected values or suspicious records.
Data Validation: restricts or flags entries that do not meet specified rules.
Text to Columns: splits combined information or helps convert certain imported values.
Power Query: provides repeatable steps for importing, transforming and combining data.
For example, if a monthly sales file has inconsistent product categories, you can use Power Query to trim spaces, standardise values and combine files from several months. When the next file arrives, the same steps can often be refreshed instead of recreated by hand.
Data cleaning with SQL
SQL is useful when the data lives in a relational database and you need to find issues before building a report. For example, this query finds orders with missing amounts or negative quantities in a table meant to contain completed sales:
SELECT
OrderID,
Quantity,
Amount
FROM Orders
WHERE Amount IS NULL
OR Quantity IS NULL
OR Quantity < 0;This query flags potential problems. A negative quantity might be valid if the table includes returns, so apply the right business rules before deciding which records are invalid. SQL is particularly valuable for large tables, because you do not need to export every record into a spreadsheet first. If you want to learn it properly, see our SQL and PHP course.
Data cleaning with Python and Pandas
Python becomes useful when you need a repeatable workflow, more flexible validation rules or processing across many files. A cleaning script can load a dataset, inspect missing values, normalise text fields, flag potential duplicates and produce a summary of records that need review.
import pandas as pd
df = pd.read_csv("sales.csv")
print("Original row count:", len(df))
# Standardise city names
df["City"] = df["City"].str.strip().str.title()
# Identify exact duplicate rows
duplicate_count = df.duplicated().sum()
print("Exact duplicate rows:", duplicate_count)
# Report missing values
print(df.isna().sum())
# Save a working copy after standardising city names
df.to_csv("sales_review.csv", index=False)Notice that this script reports duplicate rows instead of deleting them automatically. That is intentional: the analyst should understand what counts as a duplicate before making a potentially irreversible decision. The exported file is a working review copy, not a guarantee that every quality issue has been resolved. If you are new to the language, our Python course starts from the basics.
A useful rule for beginners: Excel helps you see and explore problems, SQL helps you inspect and validate database records, and Python helps you build flexible, repeatable workflows. All three are valuable in professional data analysis.
Real-World Data Cleaning Case Studies and a Practical Project
How Does Uber Monitor Data Quality at Scale?
Uber published an engineering article in August 2021 describing its work on a consolidated data quality platform. The company explained that its services and machine-learning systems depend on many datasets, and that incomplete or inaccurate data can affect downstream computations and business decisions. Its platform was designed to monitor data quality, detect problems and support incident handling. (Source: Uber Engineering Blog.)
The business challenge
In a large organisation, data is generated and processed by many different systems. A dataset may be technically available but still be incomplete, delayed or inconsistent. For example, a trip-related system might depend on up-to-date information about driver availability and customer demand. If the supply data is incomplete, downstream calculations may be affected. The problem is not solved by correcting a spreadsheet once. The organisation needs a way to detect problems as data moves through its systems.
The data quality approach
Uber's article describes defining quality checks, monitoring datasets, alerting teams when checks fail and managing incidents until they are resolved. A data quality check is a rule or test that evaluates whether a dataset meets an expected condition. Examples include:
Checking that a daily dataset contains a plausible number of records.
Comparing record counts with historical periods.
Detecting delayed or incomplete data.
Checking whether related datasets agree.
Alerting the responsible team when a rule fails.
The article reported that the platform supported more than 2,000 critical datasets and detected around 90% of data quality incidents at the time of publication. These are figures from that 2021 article, not a claim about the platform's current status.
A practical example for students
Imagine you receive a daily file containing trip records. Your normal process expects at least 10,000 records per day. Today, the file contains only 4,200. That does not automatically prove the data is wrong. Demand may genuinely have fallen, or a service may have operated differently. But the difference is large enough to investigate. You could check:
Whether the file contains the correct date.
Whether the data pipeline completed successfully.
Whether the number of records is unusually low compared with recent days.
Whether the source system had a problem.
Whether the data is complete enough to use in a report.
The key lesson is that data quality is not only about cleaning records after they arrive. It is also about detecting problems before they affect decisions. For your own project, you can build a simple version by checking daily row counts, missing fields and duplicate identifiers, then recording failed checks in a separate report.
How Does Airbnb Build Trustworthy Data?
Airbnb's engineering team has also published work on improving data quality. In its November 2023 article about its Data Quality Score, Airbnb described challenges that arose as its data environment grew, including difficulty delivering metric reports on time and understanding the dependencies behind important metrics. It discussed a system for assessing data quality across a broader set of data assets. (Source: Airbnb Engineering, published on Medium.)
The business challenge
A business metric may depend on information from multiple tables, transformations and upstream systems. For example, a metric called “active listings” sounds simple, but its exact definition may depend on listing status, dates, availability rules and other business conditions. If different teams use different definitions, they can produce different answers while believing they measure the same thing. Data quality therefore involves more than correcting spelling errors. It also requires clear definitions, documentation, reliable dependencies and confidence in how metrics are calculated.
The data quality approach
Airbnb described its earlier Midas certification process for important data assets and its later Data Quality Score initiative. The broader goal was to make quality easier to assess and improve across its data environment. Three terms are worth knowing:
A data asset is a reusable data resource, such as a table, dataset or defined metric.
A data dependency is a relationship in which one data asset or calculation relies on another. If an upstream dataset changes or becomes unreliable, downstream reports may be affected.
A data quality score summarises quality indicators into a measure that helps teams assess or compare data assets. It is useful only when its underlying criteria are clearly defined and suited to the purpose.
A practical example for students
Suppose two departments report different numbers of active customers. Department A counts every customer who placed an order in the last 90 days. Department B counts customers who placed an order in the last 30 days. Both calculations may be correct under their own definitions, but the reports are not comparable.
To improve consistency, document the definition of an active customer, identify the source tables, standardise the time window and check that both departments use the same logic. You can then add data quality tests to confirm that the required date and customer identifiers are present and that the calculations follow the agreed definition.
The lesson from Airbnb: trustworthy analysis depends on accurate records, but also on consistent definitions, documented assumptions and reliable data pipelines.
What Does a Complete Data Cleaning Project Look Like?
Now let's bring the concepts together in a project you can complete using Excel, SQL or Python. The goal is to clean a fictional e-commerce sales dataset and prepare it for a reliable sales report.
Project objective
You have received a spreadsheet containing customer orders. Your manager wants to know total sales, the best-performing cities and the products generating the most revenue. Before producing the report, you must investigate data quality issues and document your decisions.
Step 1: Inspect the raw dataset
Suppose the file contains these records:
Order ID | City | Product | Quantity | Unit Price | Status |
|---|---|---|---|---|---|
O101 | Amritsar | Keyboard | 2 | ₹800 | Completed |
O102 | Ludhiana | Mouse | 3 | ₹500 | Completed |
O103 | AMRITSAR | Keyboard | 2 | ₹800 | Completed |
O103 | AMRITSAR | Keyboard | 2 | ₹800 | Completed |
O104 | Chandigarh | Monitor | 1 | Missing | Completed |
O105 | Ludhiana | Mouse | 1 | ₹500 | Cancelled |
This small dataset contains several issues to investigate:
Order O103 appears twice.
City names use inconsistent capitalisation.
Order O104 has a missing unit price.
Order O105 is cancelled, so it may not belong in a completed-sales metric.
You also need to establish whether each row represents a distinct order or an order line. The purpose is to make decisions based on the dataset's meaning, not simply to remove every unusual record.
Step 2: Define your cleaning rules
Before editing, write down the rules you intend to apply.
Issue | Proposed Rule | Reason |
|---|---|---|
Repeated Order ID | Verify against the source before removing | A repeated ID may represent a duplicate or multiple lines |
City formatting | Standardise case and spaces | Prevent the same city appearing in multiple categories |
Missing unit price | Check the product catalogue or invoice | Avoid inventing a price |
Cancelled order | Exclude from completed-sales revenue, if that is the agreed definition | Prevent cancelled sales from inflating completed revenue |
Invalid quantity | Flag zero or negative values for review | Confirm whether they are errors, returns or adjustments |
These rules are examples for this fictional project. In a real dataset, confirm the business definitions with the data owner.
Step 3: Clean and validate the records
First, inspect the repeated O103 record. If both rows are accidental copies of the same order line, remove the confirmed duplicate. If they are two legitimate lines, keep them and revise the data model to reflect the correct structure. Next, standardise the city values. Amritsar and AMRITSAR can be made consistent once you confirm they refer to the same city.
For O104, look up the unit price in an authoritative source. If the product price is not available, leave the amount unresolved and flag the record instead of assuming it is zero. Finally, separate cancelled orders from completed sales according to the reporting definition. Then check that the cleaned dataset meets your rules, and record how many rows were changed, removed or flagged.
Step 4: Calculate revenue
For completed sales with verified prices, calculate Revenue = Quantity × Unit Price.
O101: 2 × ₹800 = ₹1,600
O102: 3 × ₹500 = ₹1,500
O103: if confirmed as an accidental duplicate, keep only one of the two identical lines. Its revenue is ₹1,600.
O104 remains unresolved until its unit price is verified. O105 is excluded from completed-sales revenue under the stated rule. The known completed-sales total after these decisions is ₹1,600 + ₹1,500 + ₹1,600 = ₹4,700.
This is the total of the verified completed records in this illustrative example. It is not a complete total for all orders, because O104 remains unresolved. A responsible analyst reports the known total and explains the limitation instead of presenting an incomplete figure as final.
Step 5: Prepare a quality summary
A useful project documents what happened to the data.
Quality Check | Result to Record |
|---|---|
Original row count | Number of rows received |
Confirmed duplicates | Number removed after verification |
Missing unit prices | Number resolved and number still unresolved |
Inconsistent city values | Number standardised |
Cancelled orders | Number excluded from completed-sales calculations |
Final usable records | Number available for the defined analysis |
Remaining limitations | Issues that could affect the results |
Fill in these figures from the actual file, not by inventing a quality score. A quality summary helps your reviewer understand how the final results were produced and what still needs attention.
Step 6: Present the final findings
Once the data is reliable enough, create a sales summary in Excel, SQL or Power BI. You might report:
Total verified revenue from completed orders.
Revenue by city.
Revenue by product.
Number of completed and cancelled orders.
The number of records excluded or awaiting verification.
Explain the cleaning decisions alongside the results. This matters most when exclusions or missing values could materially affect the report. Your project is now more than a spreadsheet exercise. It shows how you investigate data, apply rules, verify calculations and communicate limitations.
How Do You Practise Data Cleaning and Build a Portfolio?
You can develop data cleaning skills using public datasets or small fictional datasets that you create yourself.
Choose a dataset with realistic problems
Look for datasets with dates, categories, numeric measurements and identifiers. These fields give you chances to practise several cleaning techniques. Good places to explore include:
Kaggle Datasets for retail, customer, marketing and other datasets.
The UCI Machine Learning Repository for datasets used in research and education.
The Pandas documentation for examples of data manipulation and missing-value handling.
Microsoft Learn for data preparation and reporting workflows in Power BI.
Always review the dataset's description and usage terms. A dataset with missing values or unusual records is not necessarily defective. The issues may be intentional, or part of the research question.
Practise with a repeatable workflow
For each dataset, follow the same general process:
Describe what each row represents.
Identify important columns and their expected formats.
Count missing values and investigate duplicates.
Check ranges, categories and relationships between fields.
Apply documented cleaning rules.
Compare important statistics before and after cleaning.
Save the cleaned output and document unresolved issues.
Over time, you can automate parts of this workflow with Python, SQL or Power Query.
Turn your work into a portfolio project
A strong portfolio project shows both the final output and the reasoning behind it. Include the original dataset source, the quality problems you found, the rules you applied, the tools you used, the validation checks you performed and the limitations that remain. If you use Python, include readable code and explain the important steps. If you use Excel, show the key transformations and validation checks. If you use SQL, provide the queries and explain what each one tests.
Never claim that you improved data quality by a particular percentage unless you calculated it with a clearly defined metric and documented the method. Your aim is to show that you can make data more reliable without changing its meaning. That is a valuable skill for data analysis, reporting and many other data-related roles.
Frequently Asked Questions About Data Cleaning
What is data cleaning in simple words?
Data cleaning means finding and addressing problems in a dataset so the information is suitable for analysis. It includes investigating missing values, duplicates, inconsistent formats, invalid records and unusual observations.
What are the main data cleaning techniques?
Common techniques include handling missing values, removing confirmed duplicates, standardising text and date formats, validating ranges, investigating outliers and checking relationships between fields. The correct method depends on the data and the business question.
What is the difference between data cleaning and data preprocessing?
Data cleaning focuses on identifying and resolving data quality problems. Data preprocessing is a broader term that can include cleaning, transformation, encoding categorical variables, scaling numerical features and preparing data for analysis or machine learning. The terms overlap, and their exact meanings depend on the workflow.
How do you handle missing values in a dataset?
First, find out why the values are missing and whether they can be recovered from a reliable source. Depending on the situation, you may keep the missing values, remove selected records, use a justified imputation method or flag the affected observations. Avoid replacing every missing value with zero.
How can I remove duplicate data in Excel?
Select the relevant table and use Data → Remove Duplicates. Choose the columns that define a duplicate, then review how many rows were removed. Keep a copy of the original data and verify that legitimate transactions were not deleted.
Which tool is best for data cleaning?
Excel is a useful starting point for smaller spreadsheets. Power Query supports repeatable transformations, SQL helps inspect and validate database records, and Python with Pandas offers flexible automation and data processing. The best tool depends on your dataset, workflow and experience.
Is data cleaning required before every data analysis project?
You should assess data quality before every analysis, but that does not mean every dataset needs heavy changes. A reliable, well-documented dataset may need only a few validation checks. The important thing is to verify that the data is suitable for the question you are asking.
What is an outlier in data cleaning?
An outlier is an observation that differs substantially from other values in a dataset. It may indicate an error, a rare event or a legitimate unusual case. Investigate the cause before deciding whether to correct, keep or exclude it.
How do I learn data cleaning as a beginner?
Start with Excel or Google Sheets and practise finding blanks, duplicates, inconsistent categories and invalid values. Then learn SQL for database checks and Python with Pandas for repeatable cleaning. Complete a project in which you document the original problems, cleaning decisions, validation results and final findings.
Why is data cleaning important in machine learning?
Machine-learning models learn from the examples they are given. Incorrect labels, inconsistent units, duplicated records and poorly handled missing values can undermine training or distort evaluation results. Appropriate cleaning and validation make the data more trustworthy, although they cannot guarantee model accuracy.
Start Building Your Data Analysis Skills with Webcooks
Data cleaning may not be the most exciting part of a project, but it is one of the foundations of trustworthy analysis. The quality of your final report depends on understanding the data, checking assumptions and making careful decisions about what to change.
Start with a small dataset. Identify one problem, investigate its cause, apply a justified solution and verify the result. Then repeat the process with more complex data. As you grow more confident with Excel, SQL, Python and reporting tools, focus on explaining not just what you changed, but why the change was appropriate.
At Webcooks, an ISO 9001:2015 certified IT training institute and digital agency in Amritsar, our data analytics course teaches Excel, SQL, Python and Power BI with real datasets and projects like the one in this guide. Book a free demo class or call us on +91 82838 09241 to talk to our team.
Clean data is not data that merely looks neat. It is data you understand, have checked and can responsibly use to support a decision.
Written by
Udit
Webcooks Team