Skip to main content
Basics of Data Analysis & Data Cleaning
Data Analysis
Data Analysis = Process of inspecting, cleaning, transforming, and
modeling data.
Objective → Extract useful information & support decision-making.
Examples:
• Predicting sales for next quarter
• Understanding customer buying patterns
• Tracking business performance
Companies use data analysis to predict sales, to understand which
products are popular, or to decide where to spend their marketing
budget.
Data Cleaning
Garbage In = Garbage Out
Problems with raw data:
• Missing values
• Duplicates
• Inconsistencies
• Wrong formats
Clean data ensures:
• Accurate results
• Reliable decision-making
Analyzing customer data where ages are missing or country names are
inconsistent—your analysis will be misleading. Data cleaning helps us avoid
these mistakes
Types of Data
Structured Data: Tables, databases, spreadsheets (e.g., Excel, SQL).
• It is neat and organized in rows and columns.
Unstructured Data: Text, images, videos, audio (e.g., tweets, photos).
• It has no fixed format—think of social media posts or YouTube videos.
Semi-structured Data: JSON, XML, log files
• It is in between; for example, JSON files have tags but are not neatly
tabular
Data Analysis Workflow
1. Data Collection – surveys, databases, sensors.
2. Data Cleaning – remove errors and prepare dataset.
3. Exploratory Data Analysis (EDA) – spotting patterns.
4. Data Visualization – charts, dashboards.
5. Reporting – insights for decision-making
Step 1 – Remove Duplicates
• Duplicate records = same data appearing multiple times.
• Example:
101 | Riya | India
101 | Riya | India
• This can inflate counts and skew results.
• Removing duplicates is one of the first things we should do.
• Solution: Use Excel “Remove Duplicates” or filter
Step 2 – Handle Missing Values
Missing or blank values are frequent in datasets.
Ways to handle:
• Delete missing rows (if few)
• Fill with mean/median/mode
• Replace with default value (“Unknown”)
Step 3 – Correct Inconsistencies
• Problem: Same data written in different ways
• “IN”, “IND”, “India”
• Solution: Standardize to one format
 Step 4 – Format Data
• Convert data to correct format:
• Dates → DD/MM/YYYY
• Numbers → Numeric (remove $/INR symbols)
• Text → Proper case (e.g., ‘Priyanka’ not ‘PRIYANKA’).
Step 5 – Standardize Dataset
Make categories consistent across dataset.
Example:
Gender → “Male / Female” instead of “M / F / male”
Country → “India” not “Ind”
Data Cleaning in Excel – Step by Step
• 1. Remove Duplicates
• Steps:
• Select the entire dataset (Ctrl + A).
• Go to Data → Remove Duplicates.
• Select all columns and press OK.
Duplicate rows will be deleted.
2. Fill Missing Age with the Average
• Steps:
• Calculate the average of available ages:
• In a blank cell, type:
• =AVERAGE(B2:B100)
• Copy this average.
• Select blank cells in the Age column → Right-click → Paste Special →
Values. OR use a formula directly in Age column:
=IF(ISBLANK(B2), AVERAGE($B$2:$B$100), B2)
• Replace formulas with values (Copy → Paste as Values).
3. Standardize Country Names
Steps:
Select the Country column.
• Press Ctrl + H (Find & Replace).
• Find: IND → Replace with: India
• Find: IN → Replace with: India
• Find: INDIA → Replace with: India.
Formula method (if you want a new column):
=IF(OR(C2="IND",C2="IN",C2="INDIA"),"India",C2)
4. Format Purchase_Date to DD/MM/YYYY
Steps:
• Select the Purchase_Date column.
• Go to Home → Number group→ Short Date. or
• Right-click → Format Cells → Custom → dd/mm/yyyy.
All dates will appear in the same format.
• If some cells still look like text:
=DATEVALUE(D2)
5. Convert Amount into Numeric Values
Steps:
• Insert a new column called Clean_Amount.
• Use this formula:
=VALUE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(D2,"$",""),
"INR ",""),"Rs. ",""),"₹",""))
• Copy → Paste as Values → Replace original column.
• Format as Number.