Introduction
As a data analyst, you'll quickly outgrow basic Excel formulas like SUM and AVERAGE. Advanced Excel functions are your power tools for handling complex data analysis tasks—from looking up customer information across multiple tables to calculating conditional aggregates.
Companies like Flipkart, Swiggy, and Zomato use these functions daily to analyze sales data, track delivery metrics, and understand customer behavior. Mastering these functions can reduce hours of manual work into seconds of formula magic.
What You'll Learn
In this topic, you'll master five essential advanced Excel functions:
- VLOOKUP - Look up values across tables (e.g., find customer details by ID)
- INDEX-MATCH - More flexible and powerful alternative to VLOOKUP
- SUMIFS/COUNTIFS - Sum or count with multiple conditions
- IF with nested logic - Make complex decisions in formulas
- Array formulas - Perform calculations on entire columns at once
Getting Started
Prerequisites:
- Basic Excel knowledge (SUM, AVERAGE, simple formulas)
- Understanding of cell references (A1, $A$1, etc.)
- Familiarity with filtering and sorting data
Setup: Open Excel and create a sample dataset to practice along. We'll use Swiggy delivery data as our example throughout this lesson.
VLOOKUP: The Data Lookup Workhorse
VLOOKUP (Vertical Lookup) searches for a value in the first column of a table and returns a value from another column in the same row.
Syntax:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])Real Example - Swiggy Order Analysis:
Imagine you have two tables:
- Orders Table: Order ID, Customer ID, Order Amount
- Customers Table: Customer ID, Customer Name, City
To find the city for each order:
=VLOOKUP(B2, Customers!$A$2:$C$100, 3, FALSE)Where:
B2= Customer ID to look upCustomers!$A$2:$C$100= Customer table range (use $ for absolute reference)3= Return value from 3rd column (City)FALSE= Exact match only
Think of VLOOKUP like using a restaurant menu. You look down the left column for the dish name (lookup value), then read across to see the price (return value). VLOOKUP does this automatically for thousands of rows!
⚠️ CheckpointQuiz error: Missing or invalid options array
INDEX-MATCH: The Superior Alternative
INDEX-MATCH is more flexible than VLOOKUP because it can search in any direction and is faster for large datasets.
Syntax:
=INDEX(return_range, MATCH(lookup_value, lookup_range, 0))Example - Finding Restaurant Ratings:
=INDEX(Ratings!$C$2:$C$500, MATCH(A2, Ratings!$A$2:$A$500, 0))This finds the rating (column C) for a restaurant ID (matching column A).
Why INDEX-MATCH beats VLOOKUP:
- Can look left (VLOOKUP can't)
- Faster for large datasets (1M+ rows)
- Doesn't break when you insert columns
- Can use dynamic ranges
SUMIFS & COUNTIFS: Conditional Aggregation
These functions sum or count based on multiple criteria—essential for segmented analysis.
SUMIFS Syntax:
=SUMIFS(sum_range, criteria_range1, criteria1, criteria_range2, criteria2, ...)Example - Swiggy Revenue by City and Month:
Calculate total revenue for Delhi orders in January:
=SUMIFS(Orders!$D:$D, Orders!$B:$B, "Delhi", Orders!$C:$C, ">=1/1/2024", Orders!$C:$C, "<=1/31/2024")Where:
Orders!$D:$D= Revenue column to sumOrders!$B:$B= City column"Delhi"= City criteriaOrders!$C:$C= Date column (used twice for date range)
Pro Tip: Use cell references instead of hardcoding criteria. Replace "Delhi" with $F$2 where F2 contains the city name. This makes your formula dynamic and reusable!
Nested IF Statements: Complex Logic
Nested IFs let you create multi-tier decision trees in your formulas.
Example - Categorizing Order Values:
=IF(D2>=1000, "High Value", IF(D2>=500, "Medium Value", "Low Value"))This categorizes orders:
- ₹1000 or more = "High Value"
- ₹500 to ₹999 = "Medium Value"
- Below ₹500 = "Low Value"
For Flipkart's Customer Segmentation:
=IF(AND(E2>=10, F2>=50000), "VIP", IF(OR(E2>=5, F2>=25000), "Premium", "Regular"))Where:
- E2 = Number of orders
- F2 = Total spent
Logic: VIP if 10+ orders AND ₹50k+ spent, Premium if 5+ orders OR ₹25k+ spent, else Regular.
Real-World Example: Zomato Delivery Performance Dashboard
Let's combine these functions to analyze delivery performance.
Scenario: You have:
- Orders sheet: Order ID, Restaurant ID, Delivery Partner ID, Delivery Time (minutes), Order Date
- Partners sheet: Partner ID, Partner Name, City
- Target: 30 minutes
Analysis Goals:
- Find partner name for each order
- Calculate late deliveries (>30 min)
- Count late deliveries by city
Solution:
// 1. Partner Name (using INDEX-MATCH)
=INDEX(Partners!$B:$B, MATCH(C2, Partners!$A:$A, 0))
// 2. Late Delivery Flag (using IF)
=IF(D2>30, "Late", "On Time")
// 3. Late Deliveries by City (using COUNTIFS)
=COUNTIFS(Orders!$E:$E, "Late", Partners_Orders!$G:$G, "Mumbai")Where column E has the Late/On Time flags from formula 2, and column G has city (joined from Partners sheet).
Common Pitfall: When using VLOOKUP/INDEX-MATCH across sheets, always use absolute references ($A$2:$C$100) for your lookup tables. Otherwise, copying formulas will shift your table range and break your lookups!
Common Mistakes to Avoid
-
VLOOKUP approximate match: Using
TRUE(approximate match) when you need exact matches causes wrong results. Always useFALSEunless working with sorted numerical ranges. -
Circular references in SUMIFS: Accidentally including the sum result cell in your sum_range creates a circular reference error. Keep your result cells separate from data ranges.
-
Hardcoding criteria: Writing
"Delhi"instead of$F$2makes formulas inflexible. Use cell references for criteria so you can change filters without editing formulas. -
Not handling errors: VLOOKUP returns
#N/Awhen no match is found. Wrap in IFERROR:=IFERROR(VLOOKUP(...), "Not Found") -
Forgetting to lock references: When copying formulas, forgetting
$signs causes your lookup ranges to shift. Use$A$1for absolute references.
⚠️ SummarySection error: Missing or invalid items array
Received: {"hasItems":false,"isArray":false}
⚠️ FinalQuiz error: Missing or invalid questions array