Lookup Functions: XLOOKUP, VLOOKUP, INDEX-MATCH and Dynamic Arrays: Practice Questions and Answers [Free PDF]
Knowing XLOOKUP vs INDEX MATCH vs VLOOKUP and modern dynamic arrays is essential for linking financial statements, pulling comparable company multiples, and passing Excel modeling tests in exams, FMVA/CFA prep, university courses, and finance interviews. This chapter delivers 30 practical Q&As and 15 MCQs covering exact and approximate lookups, two-way matrix lookups, scenario switches with CHOOSE and OFFSET, FILTER/SORT/UNIQUE/SEQUENCE, and debugging #N/A and #REF! errors.
This is Chapter 2 of 16 (Module 1: Excel Foundations & Data Modeling for Business · Beginner) in our Financial Modeling & Excel course. Review Essential Excel Formulas and Functions for Business and Finance first, or continue with PivotTables, Power Query and Data Cleaning in Excel afterwards.
VLOOKUP, HLOOKUP, and Their Limitations
Q1. How does VLOOKUP work, and what do each of its four arguments control?
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]) searches vertically down the first column of table_array for lookup_value and returns a value from the same row in the specified column number.
- lookup_value: The key to search for (e.g., ticker
"AAPL"or cellA2). - table_array: The full data table, locked with
$(e.g.,$A$2:$F$100). - col_index_num: The column position to return, counting from 1 at the leftmost column of
table_array. - range_lookup:
FALSE(or0) for an exact match;TRUE(or1, default if omitted) for an approximate match on sorted ascending data.
Example: =VLOOKUP("MSFT", $A$2:$E$50, 4, FALSE) pulls Microsoft’s EBITDA from column 4 of a trading comps table.
Q2. What are the five major limitations of VLOOKUP in professional financial models?
Investment banks and FP&A teams largely restrict or avoid VLOOKUP in live models because of five structural weaknesses:
- No left lookup: The lookup column must always be the leftmost column of
table_array. - Fragile column index: Inserting or deleting a column inside
table_arraysilently shifts data and causes a hardcodedcol_index_num(like4) to pull the wrong metric. - Unsafe default match mode: Omitting the fourth argument defaults to approximate match (
TRUE), which returns wrong numbers on unsorted tables. - No built-in error fallback: Requires wrapping in
IFERRORorIFNAto handle missing tickers. - Performance overhead: Locking wide ranges (e.g.,
A:Z) forces Excel to track unnecessary intermediate columns.
Q3. When is VLOOKUP with an approximate match (TRUE) actually useful in finance?
Approximate match (TRUE or 1) is ideal for tiered rate tables where you look up a continuous number inside ascending brackets, such as federal tax brackets, volume-discount tiers, or credit-rating spread tables.
Suppose column A holds minimum revenue thresholds ($0, $100,000, $500,000, $1,000,000) sorted in strict ascending order, and column B holds commission rates (5%, 7%, 9%, 12%). For a rep with $650,000 in sales (E2):
=VLOOKUP(E2, $A$2:$B$5, 2, TRUE)
Excel finds the largest threshold less than or equal to $650,000 ($500,000) and returns 9%. If the table is not sorted ascending, approximate match produces completely unreliable results.
Q4. How does HLOOKUP differ from VLOOKUP, and where does it appear in corporate finance models?
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup]) is the horizontal counterpart to VLOOKUP: it searches across the top row of table_array and returns a value from the specified row_index_num below it.
Because financial statements arrange years horizontally across columns (e.g., 2024 to 2029 in row 4), HLOOKUP is often used in legacy models to pull a specific year’s Free Cash Flow or Revenue: =HLOOKUP(2027, $B$4:$G$20, 12, FALSE). However, like VLOOKUP, it breaks if someone inserts a row above row 12, so XLOOKUP or INDEX-MATCH is strongly preferred.
Q5. How can you make VLOOKUP dynamic so inserting a column does not break the formula?
You can replace the hardcoded col_index_num with a MATCH function that looks up the column header name dynamically:
=VLOOKUP($A2, Comps!$A$2:$G$50, MATCH(B$1, Comps!$A$1:$G$1, 0), FALSE)
Here, MATCH(B$1, Comps!$A$1:$G$1, 0) returns the live column position of the header (such as “EV/EBITDA”). If a new column is inserted in the Comps tab, MATCH updates the column index automatically. Still, INDEX-MATCH or XLOOKUP remains cleaner because it also removes the left-column restriction.
INDEX-MATCH and Two-Way Matrix Lookups
Q6. How do INDEX and MATCH work individually, and how do they combine into a superior lookup?
INDEX and MATCH are two simple functions that become a flexible lookup engine when nested together:
- MATCH(lookup_value, lookup_array, 0): Returns the relative position (an integer) of
lookup_valueinside a 1D row or column. Setting match type to0forces an exact match. - INDEX(array, row_num, [column_num]): Returns the value sitting at that exact row (and optional column) coordinate.
Combined formula: =INDEX($C$2:$C$50, MATCH(E2, $A$2:$A$50, 0)). If ticker E2 sits in the 7th row of A2:A50, MATCH returns 7 and INDEX returns the 7th cell of C2:C50. Because the lookup column and return column are independent ranges, it can look left, look right, and never breaks when columns are inserted.
Q7. How do you build a two-way (row and column) lookup with INDEX-MATCH-MATCH?
In FP&A and investment banking, you frequently need to pull a specific line item (row) for a specific fiscal year (column) from a 3-statement model. Passing two MATCH functions into INDEX solves both dimensions simultaneously:
=INDEX($B$5:$G$30, MATCH($A35, $A$5:$A$30, 0), MATCH(B$34, $B$4:$G$4, 0))
$B$5:$G$30is the numeric data body (excluding row labels and column headers).- The first
MATCHlocates the line item (e.g., “EBITDA”) down column A. - The second
MATCHlocates the year (e.g., “2027E”) across row 4.
This pattern is a Wall Street standard because it survives row insertions, column insertions, and reordered summary tables.
Q8. How can INDEX-MATCH perform a multi-criteria lookup (for example, matching both Company and Fiscal Year)?
When a flat database table has multiple rows per company (one row per year), a single-key lookup returns only the first match. You can match two or more criteria using Boolean multiplication inside MATCH:
=INDEX($D$2:$D$500, MATCH(1, ($A$2:$A$500=G2)*($B$2:$B$500=H2), 0))
Each comparison produces an array of 1s and 0s; multiplying them yields 1 only on the row where both Company (G2) and Year (H2) match. MATCH(1, ..., 0) finds that exact row. In Microsoft 365 it works natively; in older Excel versions (2019 and earlier), enter it with Ctrl + Shift + Enter.
Q9. What do MATCH’s match_type arguments (1, 0, and -1) mean?
The third argument of MATCH(lookup_value, lookup_array, [match_type]) controls how Excel searches:
- 0 (Exact match): Finds the first exact match regardless of sort order; returns
#N/Aif absent. Used 95% of the time in finance. - 1 (Less than or equal to, default): Finds the largest value <=
lookup_value; requireslookup_arraysorted in ascending order. - -1 (Greater than or equal to): Finds the smallest value >=
lookup_value; requireslookup_arraysorted in descending order.
Never omit the third argument when you want an exact match, because Excel defaults to 1.
Q10. Why do many institutional models still use INDEX-MATCH even though XLOOKUP exists?
Backward compatibility. XLOOKUP was introduced in Microsoft 365 and Excel 2021. If an investment bank sends a merger model or client presentation workbook to a board member, lender, or auditor still running Excel 2016 or 2019, XLOOKUP formulas display as _xlfn.XLOOKUP and can evaluate to #NAME? if recalculated.
INDEX-MATCH works identically in every version of Excel ever released, as well as Google Sheets and Apple Numbers, making it the safest universal standard for external client deliverables.
XLOOKUP Mastery and Comparison
Q11. What is the full syntax of XLOOKUP, and why is it simpler and safer than VLOOKUP?
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
Only the first three arguments are required:
=XLOOKUP(A2, $B$2:$B$100, $C$2:$C$100, "Not Found")
It improves on VLOOKUP in four immediate ways: it defaults to an exact match (match_mode = 0), it looks left or right (or horizontally across rows), it includes a built-in if_not_found argument so you rarely need IFNA, and it references only the lookup and return columns so inserting columns never breaks the formula.
Q12. How do XLOOKUP’s match_mode and search_mode arguments handle approximate matches, wildcards, and reverse lookups?
The 5th argument (match_mode) and 6th argument (search_mode) unlock advanced finance workflows without workarounds:
- match_mode = 0: Exact match (default).
- match_mode = -1: Exact match or next smaller item (ideal for tax brackets or commission tiers, even without sorting).
- match_mode = 1: Exact match or next larger item (ideal for debt maturity buckets or packaging sizes).
- match_mode = 2: Wildcard match using
*and?. - search_mode = -1: Searches from bottom to top (last to first). For example, pulling the most recent stock closing price or latest invoice for a customer from a chronological log:
=XLOOKUP("NVDA", A2:A5000, D2:D5000, "Missing", 0, -1).
Q13. How do VLOOKUP, INDEX-MATCH, and XLOOKUP compare across key financial modeling criteria?
Interviewers frequently ask candidates to compare Excel’s three primary lookup methods.
| Feature | VLOOKUP | INDEX-MATCH | XLOOKUP |
|---|---|---|---|
| Default match type | Approximate (TRUE) | Approximate (1 if omitted) | Exact (0) |
| Look to the left? | No | Yes | Yes |
| Survives column inserts? | No (unless paired with MATCH) | Yes | Yes |
| Built-in not-found fallback? | No | No | Yes (4th argument) |
| Reverse search (last match)? | No | Complex workaround | Yes (search_mode = -1) |
| Returns multiple columns? | No | Requires array formula | Yes (spills natively) |
| Excel 2016/2019 compatibility? | Yes | Yes | No (M365 / Excel 2021+) |
Q14. How can XLOOKUP return an entire row of metrics at once or perform a two-way matrix lookup?
Returning multiple columns: If return_array spans multiple columns (e.g., Revenue, EBITDA, and Net Income in C2:E50), a single XLOOKUP spills all three values horizontally: =XLOOKUP("AAPL", $A$2:$A$50, $C$2:$E$50).
Two-way lookup with nested XLOOKUP: To look up both a line item ($A35 in $A$5:$A$30) and a year (B$34 in $B$4:$G$4) inside data block $B$5:$G$30:
=XLOOKUP($A35, $A$5:$A$30, XLOOKUP(B$34, $B$4:$G$4, $B$5:$G$30))
The inner XLOOKUP returns the entire column for the matching year, and the outer XLOOKUP picks the matching row from that column.
Q15. How do you run a multi-criteria lookup in XLOOKUP?
You can either concatenate keys or use Boolean multiplication. Boolean multiplication is safer because it avoids accidental collisions (such as “AB” + “C” colliding with “A” + “BC”):
=XLOOKUP(1, ($A$2:$A$500=G2)*($B$2:$B$500=H2), $D$2:$D$500, "Not Found")
Here, ($A$2:$A$500=G2)*($B$2:$B$500=H2) generates an array of 1s and 0s, and XLOOKUP locates the first 1 and returns the corresponding dollar value from column D.
CHOOSE, OFFSET, and Scenario Modeling
Q16. How does the CHOOSE function power Bear, Base, and Bull scenario switches in financial models?
=CHOOSE(index_num, value1, value2, [value3], ...) selects an item from a list based on an integer switch (1, 2, 3, etc.).
In a corporate forecast, place an integer Scenario Switch in cell $C$2 (1 = Base, 2 = Upside, 3 = Downside) and store annual revenue growth rates for each case in rows 6, 7, and 8. The active driver row uses:
=CHOOSE($C$2, D6, D7, D8)
When an executive changes cell C2 from 1 to 2, every linked revenue, EBITDA, and DCF output updates instantaneously. Unlike OFFSET, CHOOSE is non-volatile and lightweight.
Q17. How does OFFSET work, and how is it used to create trailing 12-month (TTM) or rolling averages?
=OFFSET(reference, rows, cols, [height], [width]) returns a cell or dynamic range shifted a specified number of rows and columns from a starting anchor, optionally resized to a given height and width.
To compute a rolling 12-month (TTM) revenue sum ending in the current month column N10:
=SUM(OFFSET(N10, 0, -11, 1, 12))
Starting at N10, Excel moves 0 rows and 11 columns left (to the start of the 12-month window) and builds a range 1 row high by 12 columns wide, then sums it. You can also tie the width argument to a user-selected cell (e.g., 3, 6, or 12 months) for interactive dashboards.
Q18. Why is OFFSET considered a volatile function, and what non-volatile alternative do senior modelers prefer?
A volatile function (such as OFFSET, INDIRECT, TODAY, NOW, and RAND) forces Excel to recalculate itself and every downstream dependent cell whenever any cell in the entire workbook changes, even if its inputs were untouched. In large LBO or multi-entity FP&A workbooks, hundreds of OFFSET formulas cause noticeable lag.
Non-volatile alternative: Use INDEX to return a cell reference inside a range operator (:). For a dynamic cumulative sum from B10 through the Nth column (where N is in $B$2):
=SUM(B10:INDEX(B10:M10, 1, $B$2))
INDEX recalculates only when its precedents change, keeping large models fast and responsive.
Q19. When should you use INDEX vs CHOOSE for switching scenarios in a 3-statement model?
Both CHOOSE and INDEX are non-volatile and widely accepted on Wall Street, with a subtle structural trade-off:
- CHOOSE:
=CHOOSE($C$2, D6, D7, D8)works even if the scenario rows are non-contiguous, and makes each case explicitly visible in the formula bar. - INDEX:
=INDEX(D6:D8, $C$2)is shorter and scales effortlessly if you expand from 3 scenarios to 10 scenarios, because you only adjust the contiguous rangeD6:D15instead of listing 10 separate arguments.
Q20. How does INDIRECT work, and why do model auditors generally discourage it?
=INDIRECT(ref_text) converts a text string into a live cell reference. For example, if cell A2 holds a sheet name like "EMEA", =INDIRECT("'"&A2&"'!D12") pulls cell D12 from the EMEA tab dynamically.
Auditors discourage INDIRECT for three reasons: it is volatile (slowing recalculation), it fails to update if a target row or column is inserted/deleted (because the cell address is frozen inside quotes), and it breaks links to closed external workbooks (returning #REF!).
Dynamic Arrays: FILTER, SORT, UNIQUE, and SEQUENCE
Q21. What are dynamic arrays and spill ranges in modern Excel, and what causes a #SPILL! error?
In Microsoft 365 and Excel 2021+, a single formula entered in one cell can return multiple values that automatically “spill” into adjacent empty cells (highlighted by a thin blue border). You can reference the entire dynamic spill range using the spill range operator (#), such as =SUM(E2#).
A #SPILL! error occurs when one or more cells in the destination spill area already contain data, formatting text, or a merged cell blocking the output, or when a dynamic array formula is placed inside a structured Excel Table (which does not support spilling). Clearing the obstructing cells resolves #SPILL! immediately.
Q22. How does the FILTER function extract multi-row subsets that XLOOKUP cannot?
While XLOOKUP and INDEX-MATCH return only a single matching record (the first or last match), =FILTER(array, include, [if_empty]) returns all matching rows dynamically.
To pull every SaaS deal in A2:E500 from the “North America” region (column B) with ACV above $100,000 (column E):
=FILTER(A2:E500, (B2:B500="North America")*(E2:E500>100000), "No Deals")
Notice that AND logic uses multiplication (*), while OR logic uses addition (+), such as (B2:B500="US")+(B2:B500="UK"). Whenever source data changes, the filtered output expands or shrinks automatically.
Q23. How do SORT, SORTBY, and UNIQUE combine with FILTER to build live executive dashboards?
Dynamic array functions nest cleanly to replace manual sorting, deduplicating, and PivotTable refreshes:
- UNIQUE(array): Extracts a distinct list of customers, regions, or tickers from a raw transaction log (e.g.,
=SORT(UNIQUE(B2:B500))creates an alphabetized dropdown list). - SORT(array, [sort_index], [sort_order]): Sorts a spilled array by column number (
1= ascending,-1= descending). - SORTBY(array, by_array1, [sort_order1]): Sorts an array by a separate column that does not even need to appear in the output.
Combined example: Show all active deals above $50,000 sorted from highest to lowest value (column 5):
=SORT(FILTER(A2:E500, (C2:C500="Active")*(E2:E500>50000), "None"), 5, -1)
Q24. How does the SEQUENCE function automate loan amortization schedules and forecast headers?
=SEQUENCE(rows, [columns], [start], [step]) generates an array of sequential numbers dynamically without manually dragging fill handles.
- Forecast years across columns:
=SEQUENCE(1, 5, 2026, 1)generates2026, 2027, 2028, 2029, 2030across 5 columns. - Dynamic loan schedule periods: If a user inputs loan term in years in
B2(e.g., 5 years = 60 months),=SEQUENCE(B2*12)generates payment numbers 1 through 60 automatically. - Monthly dates: Combining with
EDATE:=EDATE(StartDate, SEQUENCE(1, 12, 0, 1))builds 12 consecutive monthly dates in one formula.
Q25. Summarize the four essential dynamic array functions for business and finance analytics.
These four functions form the modern Excel toolkit for automated reporting and dashboarding.
| Function | Syntax | Example Formula | Finance Use Case |
|---|---|---|---|
FILTER | =FILTER(array, include, [if_empty]) | =FILTER(A2:D100, C2:C100>50000, "None") | Extracting all high-value deals or overdue invoices |
SORT | =SORT(array, [sort_index], [order]) | =SORT(A2:D20, 4, -1) | Ranking companies by Enterprise Value descending |
UNIQUE | =UNIQUE(array) | =SORT(UNIQUE(B2:B500)) | Building clean lists of cost centers or tickers |
SEQUENCE | =SEQUENCE(rows, [cols], [start], [step]) | =SEQUENCE(60, 1, 1, 1) | Generating dynamic loan payment periods or years |
Troubleshooting Lookup and Reference Errors
Q26. What are the top four root causes of a #N/A error in XLOOKUP, VLOOKUP, or MATCH, and how do you fix them?
#N/A means “value not available” because Excel could not find the lookup value. When the item visually appears to exist in the table, check these four hidden culprits:
- Data type mismatch (number stored as text): Looking up numeric
1045against text"1045"fails. Fix by converting both sides consistently (e.g.,VALUE()or--, or Text to Columns). - Trailing or leading spaces: ERP exports often append invisible spaces (
"AAPL "vs"AAPL"). Clean the source column withTRIM(). - Unlocked lookup range: Forgetting
$signs causes the lookup table to shift down as you copy the formula, pushing top rows out of scope. - Mismatched range lengths: In
XLOOKUPorINDEX-MATCH, ensure lookup and return arrays start and end on the exact same rows (otherwiseXLOOKUPreturns#VALUE!orINDEX-MATCHpulls offset rows).
Q27. What causes a #REF! error in financial models, and how do you prevent it?
#REF! occurs when a formula points to an invalid cell coordinate. Common causes include:
- Deleting a row, column, or worksheet that another formula references directly.
- Providing a
col_index_numinVLOOKUPthat exceeds the number of columns intable_array(e.g., asking for column 6 in a 4-column table). - Copying a relative reference past column A or row 1, or pointing
OFFSEToff the edge of the worksheet.
Prevention: Before deleting any row or tab, run Formulas > Trace Dependents to confirm no downstream statement relies on it. If you see #REF! after an edit, press Ctrl + Z immediately rather than trying to guess the deleted cell.
Q28. How do you diagnose common Excel lookup errors at a glance?
Fast error diagnosis is a practical test of Excel fluency during timed modeling exams.
| Error Code | Meaning | Most Common Lookup Cause | Immediate Fix |
|---|---|---|---|
#N/A | Not Available | Missing key, trailing spaces, or text-vs-number mismatch | Check TRIM(), data types, and $ locks |
#REF! | Invalid Reference | Deleted source row/tab or col_index_num out of bounds | Undo deletion or verify table_array width |
#VALUE! | Wrong Value Type | Mismatched array heights in XLOOKUP or text in math | Align start/end rows of lookup and return ranges |
#NAME? | Unrecognized Name | Typo in function name or missing quotes around text key | Fix spelling or wrap text strings in " " |
#SPILL! | Blocked Spill Area | Existing data or merged cell blocking dynamic array output | Clear obstructing cells or move outside Excel Table |
Q29. How do you handle duplicate lookup keys when VLOOKUP or XLOOKUP only returns one match?
Lookup functions are designed for one-to-one or many-to-one relationships (like pulling a company’s sector from a master list). If your data table contains multiple transactions for the same customer or ticker:
- To aggregate numeric values (sum, average, count): Do not use a lookup function; use
SUMIFS,AVERAGEIFS, orCOUNTIFS. - To return the most recent entry: Use
XLOOKUP(..., search_mode = -1)on chronologically sorted data. - To list all matching rows: Use
FILTER(table, key_col = target). - To make keys unique: Combine two fields (such as Customer ID and Invoice Date) in a multi-criteria lookup.
Q30. How can you use the Evaluate Formula tool (and F9 partial evaluation) to debug a nested lookup?
When a nested INDEX-MATCH or FILTER formula returns an unexpected result, never guess blindly:
- Evaluate Formula (Formulas > Evaluate Formula): Steps through the formula one underlined sub-expression at a time so you can see exactly whether
MATCHreturned#N/Aor the wrong row number. - F9 Partial Evaluation: Click inside the formula bar, highlight a sub-expression (such as
MATCH(E2, $A$2:$A$50, 0)), and pressF9to preview its live result. Crucially, pressEsc(neverEnter) afterward so you do not overwrite the formula with a hardcoded number.
Quick Revision Points
- VLOOKUP cannot look left, defaults to an unsafe approximate match (TRUE), and breaks silently if columns are inserted inside table_array.
- INDEX-MATCH looks in any direction, survives column insertions, supports two-way matrix lookups (INDEX-MATCH-MATCH), and works in all versions of Excel.
- XLOOKUP defaults to exact match, includes a built-in if_not_found fallback, supports reverse searches (search_mode = -1), and spills multiple columns natively in M365 and Excel 2021+.
- Use non-volatile CHOOSE or INDEX for Bear/Base/Bull scenario switches instead of volatile OFFSET or INDIRECT, which slow down large financial models.
- Use FILTER, SORT, UNIQUE, and SEQUENCE to extract multi-row subsets and build dynamic loan or forecast schedules without manual refreshes.
- When #N/A appears on a key that looks present, immediately check for trailing spaces (TRIM), text-vs-number formatting mismatches, and unlocked $ range references.
