DataScience ExamNotes
DataScience ExamNotes
Statistics is the backbone of data science. It provides mathematical tools to collect, analyze, interpret,
and present data in a meaningful way. Without statistics, data science would be mere data storage.
📌 EXAM TIP: Statistics is NOT optional in data science. Every ML algorithm has a statistical
foundation. Understand the 'why' behind algorithms, not just the 'how'.
2. TYPES OF DATA
Data classification is critical for choosing the right analysis technique and visualization method. Data is
broadly classified into Qualitative and Quantitative types.
📌 EXAM TIP: EXAM TRICK: Temperature in Celsius = Interval (0°C doesn't mean 'no
temperature'). Temperature in Kelvin = Ratio (0K = absolute zero). This distinction is commonly
tested!
Conditional Formatting automatically applies formatting (colors, icons, data bars) to cells based on their
values or formulas. It makes patterns and outliers instantly visible.
📌 EXAM TIP: Conditional Formatting does NOT change cell values — only their appearance. Use
$A$1 (absolute reference) in formulas when the rule should not shift as it applies to multiple cells.
4. DATA MANIPULATION
Data Manipulation refers to the process of organizing, transforming, and modifying data to make it more
useful for analysis. It is a fundamental step in any data pipeline.
📌 EXAM TIP: Data manipulation is the most time-consuming step in real-world data science (often
70-80% of total time). Master Excel's Power Query for cleaning large, messy datasets.
5. DATA VALIDATION
Data Validation restricts what type of data users can enter into a cell. It ensures data quality and
consistency at the point of entry, preventing errors before they happen.
📌 EXAM TIP: Use 'Circle Invalid Data' (Data → Data Validation → Circle Invalid Data) to find cells
that already violate validation rules after validation was applied retroactively.
6. FILTERS
Filters allow you to display only the rows that meet specific criteria, temporarily hiding rows that don't
match. The data is not deleted — just hidden.
AutoFilter
• Enable: Select any cell in dataset → Data Tab → Filter (or Ctrl+Shift+L)
• Dropdown arrows appear in the header row
• Click arrow to filter by: specific values, text/number criteria, or date groupings
• Multiple columns can be filtered simultaneously (AND logic between columns)
Filter Options
Filter Type Description
Filter by Value Check/uncheck specific values to show/hide
Text Filters Contains, Does Not Contain, Begins With, Ends
With, Equals
Number Filters Greater Than, Less Than, Between, Top 10,
Above Average
Date Filters This Week, Last Month, This Year, Before,
After, Between
Custom AutoFilter Apply two conditions (AND/OR) for the same
column
Advanced Filter
• Data Tab → Advanced → allows filtering to a different location
• Requires a Criteria Range (separate area defining filter conditions)
• Can filter unique records only
• Supports complex OR conditions across multiple fields
📌 EXAM TIP: Filtered data can be copied and pasted — only visible (filtered) rows are copied. The
status bar at the bottom shows 'X of Y records found' when a filter is active.
7. MACROS
A Macro is a recorded sequence of actions in Excel that can be replayed with a single click or keyboard
shortcut. Macros automate repetitive tasks and are written in VBA (Visual Basic for Applications).
Recording a Macro
• View Tab → Macros → Record Macro (or Alt+T+M+R)
• Give it a name (no spaces), optional shortcut key, and description
• Perform the actions you want to record
• View Tab → Macros → Stop Recording
Running a Macro
• View Tab → Macros → View Macros → Run
• Use the assigned keyboard shortcut (e.g., Ctrl+Shift+A)
• Assign to a button: Developer Tab → Insert → Button
VBA Editor
• Access: Alt+F11 opens the Visual Basic Editor (VBE)
• Macros are stored in Modules within the VBA Project
• Code can be edited, debugged, and extended manually
Macro Security
• File → Options → Trust Center → Trust Center Settings → Macro Settings
• 'Disable all macros with notification' is the recommended setting
• Macro-enabled files use .xlsm extension (not .xlsx)
📌 EXAM TIP: Macros with 'Relative References' (View → Use Relative References) record actions
relative to the active cell. Without it, macros use absolute cell addresses — always record in the
correct reference mode!
COUNTIF counts the number of cells in a range that meet a single condition. COUNTIFS extends this
to multiple conditions (AND logic).
COUNTIF Syntax
=COUNTIF(range, criteria)
COUNTIF Examples
=COUNTIF(A1:A100, "Apple") → Count cells containing "Apple"
=COUNTIF(B1:B100, ">50") → Count cells greater than 50
=COUNTIF(C1:C100, "<>"&"") → Count non-empty cells
=COUNTIF(D1:D100, D1) → Count occurrences of value in D1
=COUNTIF(A1:A100, "A*") → Count cells starting with "A"
(wildcard)
COUNTIFS Examples
=COUNTIFS(A:A,"Male",B:B,">30") → Count Male employees older than
30
=COUNTIFS(C:C,">=100",C:C,"<=200") → Count values between 100 and 200
📌 EXAM TIP: Wildcards: * matches any sequence of characters. ? matches exactly one character.
Use ~ before * or ? to treat them as literal characters (e.g., ~* searches for an asterisk).
9. CORRELATION
Correlation measures the strength and direction of the linear relationship between two variables. It tells
us how closely two variables move together.
Correlation in Excel
=CORREL(array1, array2) → Pearson correlation coefficient
=PEARSON(array1, array2) → Same as CORREL
Important Concepts
Correlation ≠ Causation: Just because two variables correlate does NOT mean one causes the other.
Spurious Correlation: Two variables may correlate by coincidence or due to a third hidden variable.
Linearity Assumption: Pearson r only measures LINEAR relationships. Non-linear relationships
require Spearman's rank correlation.
📌 EXAM TIP: CRITICAL EXAM POINT: Correlation does NOT imply causation! Ice cream sales
and drowning rates are positively correlated — because both increase in summer (confounding
variable: hot weather).
Regression analysis is a statistical method used to model and quantify the relationship between a
dependent variable (Y) and one or more independent variables (X). It is used for prediction and
forecasting.
Types of Regression
Type Description
Simple Linear Regression One independent variable (X) predicts one
dependent variable (Y)
Multiple Linear Regression Two or more independent variables predict Y
Polynomial Regression Non-linear relationship modeled using
polynomial terms
Logistic Regression Predicts binary outcomes (Yes/No, 0/1) —
classification, not regression in the traditional
sense
Regression in Excel
=[Link](x, known_y, known_x) → Predict Y for a given X
value
=SLOPE(known_y, known_x) → Calculates slope (b)
=INTERCEPT(known_y, known_x) → Calculates intercept (a)
=RSQ(known_y, known_x) → R-squared value
📌 EXAM TIP: R² ranges from 0 to 1. An R²=0 means the model explains none of the variability;
R²=1 means perfect prediction. In practice, R²>0.7 is considered a good model, but this depends on
the field.
11. SPARKLINES
Sparklines are tiny, word-sized charts that fit inside a single cell. They provide a visual representation of
data trends without taking up much space — perfect for dashboards.
Types of Sparklines
Type Best Used For
Line Sparkline Showing trends over time (stock prices,
monthly sales)
Column Sparkline Comparing values across categories (bar chart
in miniature)
Win/Loss Sparkline Showing positive/negative results (wins vs
losses, profit vs loss)
Creating Sparklines
• Select the cell where you want the sparkline to appear
• Insert Tab → Sparklines → Choose Line, Column, or Win/Loss
• Data Range: Select the row/column of data values
• Location Range: The cell where the sparkline appears
• Click OK
Descriptive statistics summarize and describe the main features of a dataset. They provide a quick
overview without drawing conclusions beyond the data itself.
📌 EXAM TIP: Use SAMPLE variance (VAR.S) and SAMPLE SD (STDEV.S) when working with a
sample from a larger population. Use POPULATION variance (VAR.P) only when you have data for
the entire population.
Fourier Analysis decomposes a complex signal (time series data) into its constituent frequencies (sine
and cosine waves). It reveals hidden periodic patterns that are not visible in raw data.
Core Concept
Any periodic signal can be represented as a sum of simple sine and cosine waves of different
frequencies, amplitudes, and phases. The Fourier Transform converts data from the time domain to the
frequency domain.
Key Terms
Term Definition
Time Domain Data plotted against time (original signal)
Frequency Domain Data plotted against frequency (after Fourier
Transform)
Amplitude Strength/height of a frequency component
Frequency How many cycles occur per unit time
Phase Shift of the wave relative to origin
DFT Discrete Fourier Transform — applied to
discrete (digital) data
FFT Fast Fourier Transform — efficient algorithm for
computing DFT
Interpreting Output
• Convert complex output to magnitude: =IMABS(complex_number)
• Plot magnitude vs. frequency — peaks indicate dominant frequencies/cycles
• Large peaks = strong periodic patterns in data
Applications
• Signal processing (audio, radio waves)
• Economic cycles (business cycle detection)
• Seasonal decomposition in sales data
• Vibration analysis in engineering
📌 EXAM TIP: Data size MUST be a power of 2 for Excel's Fourier Analysis. If your data has 100
points, pad with zeros to reach 128. FFT assumes data is periodic and equally spaced in time.
IF Function
The IF function returns one value if a condition is TRUE and another if FALSE. It is the foundation of
logical decision-making in Excel.
IF Examples
=IF(A1>=50,"Pass","Fail") → Grade pass/fail
=IF(B1>0,"Profit","Loss") → Profit/loss check
=IF(A1="","Empty","Has Data") → Check if cell is empty
IF with AND / OR
=IF(AND(A1>50, B1>50),"Both Pass","At Least One Fails")
=IF(OR(A1="Yes", B1="Yes"),"Approved","Not Approved")
Skewness
Skewness measures the asymmetry of a probability distribution. A normal (bell-shaped) distribution has
zero skewness.
Kurtosis
Kurtosis measures the 'tailedness' of a distribution — how much of the variance is due to extreme
values (outliers). It indicates whether data is heavy-tailed or light-tailed compared to a normal
distribution.
📌 EXAM TIP: IMPORTANT: Excel's KURT() function returns EXCESS kurtosis (kurtosis minus 3).
A normal distribution has excess kurtosis = 0 in Excel. Skewness and kurtosis values between -2
and +2 generally indicate acceptable normality for most statistical tests.
Effective data visualization transforms numbers into insights. Choosing the right chart type is as
important as the analysis itself.
📌 EXAM TIP: Pie charts should have NO MORE than 5 slices. Use bar charts instead when
comparing more than 5 categories. Never use 3D charts in professional/academic work as they
distort perception.
📌 EXAM TIP: LINEST and FREQUENCY are array functions — press Ctrl+Shift+Enter (not just
Enter) in older Excel versions. In Excel 365/2019, they spill automatically.
LOOKUP functions search for a value in a table and return a related value from another column/row.
They are essential for combining data from different sources.
Argument Explanation
lookup_value The value you are searching for (in the FIRST
column of table)
table_array The entire lookup table range (use $ to lock:
$A$1:$D$100)
col_index_num Which column to return (1=first col, 2=second
col, etc.)
range_lookup FALSE = Exact match (recommended). TRUE
= Approximate match (table must be sorted)
VLOOKUP Examples
=VLOOKUP("John",A:D,3,FALSE) → Find "John" in col A, return value
from col C
=VLOOKUP(101,B:E,2,FALSE) → Find ID 101 in col B, return col C
value
VLOOKUP Limitations
• Can only look LEFT to RIGHT — cannot look to the left of lookup column
• Returns first match only — won't find multiple matching values
• Breaks if columns are inserted (col_index_num becomes wrong)
• Case-insensitive — treats 'john' and 'JOHN' as same
📌 EXAM TIP: Always use FALSE (exact match) for VLOOKUP unless specifically doing salary
band or grade lookups. With TRUE, data MUST be sorted in ascending order or you'll get wrong
results!
INDEX-MATCH is the powerful alternative to VLOOKUP. It can look in any direction, is more flexible,
and doesn't break when columns are inserted.
INDEX Function
=INDEX(array, row_num, [col_num])
Returns the value at a specific row and column intersection within a range.
=INDEX(A1:A10, 3) → Returns the value in the 3rd row of
A1:A10
=INDEX(A1:D10, 3, 2) → Returns value at row 3, column 2 of
A1:D10
MATCH Function
=MATCH(lookup_value, lookup_array, [match_type])
Returns the POSITION (row/column number) of a value in a range, not the value itself.
=MATCH("John", A1:A100, 0) → Returns position of "John" in column A
INDEX-MATCH Combined
=INDEX(return_range, MATCH(lookup_value, lookup_range, 0))
Examples
=INDEX(C:C, MATCH("John",A:A,0)) → Return value from col C where col
A = "John"
=INDEX(A:A, MATCH(MAX(B:B),B:B,0)) → Return name of person with
highest score
📌 EXAM TIP: In Excel 365/2019, use =XLOOKUP() — the modern replacement for both VLOOKUP
and INDEX-MATCH. XLOOKUP syntax: =XLOOKUP(lookup, lookup_array, return_array,
[if_not_found], [match_mode], [search_mode])
What-If Analysis tools in Excel allow you to explore different outcomes by changing input values in your
formulas. There are three main What-If tools in Excel.
1. Scenario Manager
Save and compare different sets of input values (scenarios) for your model.
• Data Tab → What-If Analysis → Scenario Manager
• Click Add → Name the scenario → Specify changing cells → Enter values
• Can save multiple scenarios (Best Case, Worst Case, Most Likely)
• Click 'Summary' to create a Scenario Summary table comparing all scenarios
2. Goal Seek
Work backwards — tells you what input value is needed to achieve a specific target output.
• Data Tab → What-If Analysis → Goal Seek
• Set Cell: The formula cell (e.g., Profit cell)
• To Value: The target value you want (e.g., 100000)
• By Changing Cell: The input cell Excel should adjust (e.g., Units Sold)
• Excel adjusts the 'By Changing Cell' until the formula reaches the target
Type Description
One-Variable Data Table Tests how ONE input (e.g., interest rate) affects
the formula
Two-Variable Data Table Tests how TWO inputs (e.g., price AND
quantity) affect the formula simultaneously
📌 EXAM TIP: Goal Seek can only change ONE variable. For optimizing with constraints and
multiple variables, use Solver (Data → Solver) — it's the advanced version of Goal Seek. Solver
requires the Solver Add-in to be enabled.
ANOVA tests whether the means of three or more groups are statistically different from each other. It
extends the t-test beyond two groups while controlling the Type I error rate.
Component Meaning
SST (Total Sum of Squares) Total variation in all data from the grand mean
SSB (Between Groups / Explained) Variation due to differences between group
means — what ANOVA tests
SSW (Within Groups / Error) Variation within each group due to individual
differences
MSB (Mean Square Between) SSB / df_between = SSB / (k-1) where k =
number of groups
MSW (Mean Square Within) SSW / df_within = SSW / (N-k) where N = total
observations
F-statistic F = MSB / MSW — ratio of between-group to
within-group variance
Hypotheses
H₀ (Null): μ₁ = μ₂ = μ₃ = ... = μk (All group means are equal)
H₁ (Alternative): At least one group mean is different from the others
Decision Rule
• If F-calculated > F-critical (from F-table): Reject H₀ — means are significantly different
• If p-value < α (0.05): Reject H₀ — statistically significant difference exists
• If p-value ≥ α: Fail to reject H₀ — no significant difference
Types of ANOVA
Type When to Use
One-Way ANOVA One independent variable (factor) with 3+
groups. Ex: Test scores across 3 teaching
methods
Two-Way ANOVA Two independent variables. Tests main effects
AND interaction effect between them
Repeated Measures ANOVA Same subjects measured multiple times
(within-subjects design)
MANOVA Multiple dependent variables simultaneously
(Multivariate ANOVA)
ANOVA Assumptions
• Independence: Observations are independent of each other
• Normality: Data in each group is approximately normally distributed
• Homogeneity of Variance: Variance is similar across all groups (tested with Levene's test)
📌 EXAM TIP: ANOVA tells you AT LEAST ONE group mean differs — not which one. If F is
significant, always follow up with post-hoc tests. The p-value in ANOVA output directly corresponds
to the F-statistic. P < 0.05 = reject null hypothesis = at least one group is different.