Excel, SQL or Python — Same Task, Three Tools, One Winner
When you are at an actual workplace and your boss gives you a task, they do not care what tool you used to deliver the insights. As long as the job is done.
I always say — if something can be done with a calculator, there is no need to write a Python script (even though Python is more than capable to do arithmetic calculations with a simple line of code). Use the right tool for the job.
For a Youtube video I decided to take 1 task and execute it using Excel, SQL and Python - link at the end.
And in this newsletter we will look at 5 different tasks and how you can approach them with different tools.
1. Look up data from another table
One of the most common tasks in data work — you have two tables and you need to combine them.
Excel — XLOOKUP
=XLOOKUP(A2, customers!A:A, customers!B:B)Find the value in A2, look it up in the customers sheet column A, return the value from column B. One cell at a time.
SQL — LEFT JOIN
SELECT o.order_id, o.amount, c.customer_name
FROM orders o
LEFT JOIN customers c ON o.customer_id = c.customer_idJoin two entire tables at once. Every matching row gets combined automatically.
Python — merge
df_merged = orders.merge(customers, on='customer_id', how='left')One line. Same result as the SQL join.
When to use which: Excel for quick one-off lookups on small data.
SQL when your data lives in a database (analysis can be replicated).
Python when you are working programmatically or the dataset is large (and you might need to reproduce the result).
2. Filter rows
Show me only the rows that meet a condition.
Excel — Filter
Select your data → Data tab → Filter → click the dropdown arrow on the Amount column → Number Filters → Greater Than → type 100. Done. You can add more criteria by filtering additional columns the same way.
Or use the FILTER formula if you want to do it in a cell:
=FILTER(A2:D100, (B2:B100 > 100) * (C2:C100 = "completed"))SQL — WHERE
SELECT *
FROM orders
WHERE amount > 100
AND status = 'completed'Python — boolean indexing
high_value = df[(df['amount'] > 100) & (df['status'] == 'completed')]When to use which: Excel for quick visual filtering. SQL and Python when you need to filter programmatically, save the logic, or apply it repeatedly.
3. Group and aggregate
Calculate totals, averages or counts by category.
Excel — Pivot Table
Insert → Pivot Table → drag Category to Rows, Amount to Values, set to Sum. Very visual, easy to change, great for presenting to stakeholders.
SQL — GROUP BY
SELECT category, SUM(amount) AS total_revenue
FROM orders
GROUP BY category
ORDER BY total_revenue DESCPython — groupby
df.groupby('category')['amount'].sum().sort_values(ascending=False)When to use which:
Excel Pivot Tables are fastest for exploration and presenting to stakeholders.
SQL and Python when you need the logic saved, repeatable, or applied to millions of rows.
4. Create a calculated column
Add a new column based on existing data.
Excel — formula in a new column
=C2 * D2Type the formula in the first row, drag it down.
SQL — calculated field in SELECT
SELECT
order_id,
quantity * price_per_unit AS total_sales
FROM ordersPython — direct column creation
df['total_sales'] = df['quantity'] * df['price_per_unit']When to use which: All three are equally simple here. SQL and Python apply it to the whole dataset instantly — no dragging required.
5. Remove duplicates
Find and remove duplicate rows.
Excel — Remove Duplicates
Data tab → Remove Duplicates → select columns → OK. Done in three clicks.
SQL — DISTINCT
SELECT DISTINCT customer_id, order_date
FROM ordersPython — drop_duplicates
df = df.drop_duplicates(subset=['customer_id', 'order_date'])
print(df.shape)When to use which:
Excel is fastest for a one-off check.
SQL and Python when deduplication is part of a repeatable pipeline.
So which tool wins?
For very quick one-off analysis on a small dataset — I would always choose Excel.
If the data is in a database, I need to reproduce the result and explain my steps with comments — I will go with SQL.
If I want reproducibility, explainability, visualisations — I will choose Python.
But sometimes the answer surprises you.
This week’s YouTube video puts all three to the test on a genuinely tricky question:
“The Marketing team wants to find the top 10 spenders in each country — but only among Platinum customers. The tricky part: loyalty status changes over time. You can’t just grab the current status column. You need the status as of the end of Q1 2025.”
When I read the task I assumed Excel would be the fastest. It wasn’t. Watch to see which tool won — and why.
Watch it here → link
Where to learn and practise each tool
Excel:
Microsoft Learn — free official training from Microsoft: learn.microsoft.com
ExcelJet — practical formulas and examples: exceljet.net
SQL:
SQLZoo — free interactive exercises, great for beginners: sqlzoo.net
LeetCode SQL — real interview questions from top companies: leetcode.com/problemset/database
W3Schools SQL — quick syntax reference: w3schools.com/sql
Python:
Kaggle Learn — free, short, practical Python courses with notebooks: kaggle.com/learn
CS50P — Harvard’s free Introduction to Python course: cs50.harvard.edu/python
My Python for Beginners newsletter series — Part 1 and Part 2 are in your inbox already or in Archive → link 😊
Keep pushing 💪,
Karina
Just starting with Python? Wondering if programming is for you?
Master key data analysis tasks like cleaning, filtering, pivot and grouping data using Pandas, and learn how to present your insights visually with Matplotlib with ‘Data Analysis with Python’ masterclass.
Already know the basics and want something more hands-on?
Take the Python Challenge.
You’ll work through a real business problem, complete a portfolio-ready project, and practise the kind of analysis employers expect from junior analysts.
👉 Start with the Masterclass if you’re a complete beginner.
👉 Choose the Python Challenge if you’re comfortable with the fundamentals and want to apply them to a real project.
More from me: YouTube | TikTok | Instagram | Threads | LinkedIn

