Skip to content

Lookup and Dynamic Array Functions Interview Questions for Advanced Excel

25 Lookup and Dynamic Array Functions questions with answers for advanced excel roles — 4 easy, 17 medium, 4 hard.

About Lookup and Dynamic Array Functions

VLOOKUP, INDEX/MATCH and XLOOKUP for fetching data across sheets, along with FILTER, SORT, UNIQUE and other dynamic array functions. Interviews test exact versus approximate match, multi-criteria and two-way lookups, why lookups return #N/A, reconciliation between two lists and keeping lookups fast on lakhs of rows.

Sheet progressStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

Explain VLOOKUP syntax and the difference between exact and approximate match.

Save to ▾
Show answer
VLOOKUP(lookup_value, table_array, col_index_num, range_lookup) searches the first column of the table and returns a value from the column number given: =VLOOKUP(A2,Products!$A:$D,3,FALSE) FALSE (or 0) means exact match and is what you need for IDs and codes. TRUE, the default, means approximate match and needs the first column sorted ascending; it is used for slabs like tax or discount bands.
02

What are the main limitations of VLOOKUP?

Save to ▾
Show answer
VLOOKUP can only look to the right of the key column, so it cannot return a value from a column on the left. The column index is a hard-coded number that breaks when columns are inserted. It returns only the first match, defaults to approximate match if the last argument is forgotten, and can be slow on big ranges. XLOOKUP or INDEX/MATCH solve all of these problems.
03

What is XLOOKUP and what advantages does it have?

Save to ▾
Show answer
XLOOKUP(lookup_value, lookup_array, return_array, if_not_found, match_mode, search_mode) is available in Microsoft 365 and Excel 2021 or later: =XLOOKUP(A2,Emp[ID],Emp[Name],"Not found") It defaults to exact match, looks left or right, has a built-in not-found value, can return several columns at once, and can search from the bottom up. It replaces VLOOKUP, HLOOKUP and most INDEX/MATCH uses.
04

You need serial numbers in a list that stay continuous after rows are filtered or deleted. How do you do it?

Save to ▾
Show answer
Plain typed numbers or =ROW()-1 break when rows are hidden by a filter. Use SUBTOTAL, which ignores filtered-out rows: =SUBTOTAL(103, $B$2:B2) Function 103 is COUNTA that skips hidden rows, and the expanding range counts non-blank cells up to the current row. Now the numbering restarts from 1 for whatever is visible, which is useful in printed or shared filtered views.
05

How does INDEX/MATCH work and why is it often preferred over VLOOKUP?

Save to ▾
Show answer
MATCH finds the position of a value in a single row or column, and INDEX returns the item at that position from another range: =INDEX(Emp!$C:$C,MATCH(A2,Emp!$F:$F,0)) The return column can be to the left of the lookup column, inserting columns does not break it, and it only scans the two columns used. It works in every Excel version, which matters when files go to clients on older Excel.
06

Explain the match_mode and search_mode arguments of XLOOKUP.

Save to ▾
Show answer
match_mode: 0 exact (default), -1 exact or next smaller, 1 exact or next larger, 2 wildcard. search_mode: 1 first to last (default), -1 last to first, 2 binary search ascending, -2 binary search descending. =XLOOKUP("*Infra*",Cust[Name],Cust[ID],,2) wildcard match =XLOOKUP(A2,Log[Item],Log[Price],,0,-1) last occurrence Binary modes are fast but give wrong answers if the data is not sorted.
07

How do you do a two-way lookup that picks both a row and a column?

Save to ▾
Show answer
Use two MATCH functions inside INDEX, one for the row and one for the column: =INDEX($B$2:$M$50,MATCH($P$2,$A$2:$A$50,0),MATCH($Q$2,$B$1:$M$1,0)) Here P2 holds the product and Q2 the month. With XLOOKUP you can nest one inside another: =XLOOKUP(P2,A2:A50,XLOOKUP(Q2,B1:M1,B2:M50)) The inner XLOOKUP returns the whole month column, and the outer one picks the product row.
08

VLOOKUP returns #N/A even though you can see the value in the table. What do you check?

Save to ▾
Show answer
Check that the last argument is FALSE, then compare the two values directly with =A2=Sheet2!A5. Common causes are trailing or non-breaking spaces, one side being a number and the other text (like employee codes), and the lookup value sitting outside the first column of the range. Use LEN to spot hidden characters, and fix with TRIM, CLEAN, VALUE or by making both columns the same data type.
09

Tell me about a time a lookup gave wrong results that nobody noticed at first.

Save to ▾
Show answer
Situation: a monthly incentive sheet used VLOOKUP with the last argument left blank, so it ran an approximate match. Task: I was asked to verify payouts before release. Action: I spotted employees getting a neighbour's target, changed every lookup to exact match with XLOOKUP, and added a count of missing IDs. Result: twelve wrong payouts were corrected before payment, and exact match became our team's standard rule.
10

How do you use approximate match to apply discount or tax slabs?

Save to ▾
Show answer
Create a slab table with the lower limit of each band in ascending order and the rate next to it. Approximate match returns the row for the largest limit not greater than the value: =VLOOKUP(B2,Slabs!$A$2:$B$6,2,TRUE) =XLOOKUP(B2,Slabs[From],Slabs[Rate],,-1) If B2 is 7.5 lakh and the bands start at 0, 3, 7 and 10 lakh, the 7 lakh row is returned. Unsorted data gives wrong results silently.
11

What does INDIRECT do and what are its risks?

Save to ▾
Show answer
INDIRECT converts text into a reference, so =SUM(INDIRECT(B1&"!C2:C100")) sums the sheet whose name is typed in B1. It is useful for summary sheets that switch between months and for dependent dropdowns. The risks are that it is volatile, it breaks silently when sheets are renamed, it does not work with closed external workbooks, and formula auditing tools cannot trace it. Use it sparingly.
12

Explain the FILTER function with an example.

Save to ▾
Show answer
FILTER returns all rows that meet a condition and spills them into neighbouring cells: =FILTER(Sales,Sales[Region]="South","No data") =FILTER(Sales,(Sales[Region]=G1)*(Sales[Amount]>100000)) Multiplying conditions means AND; adding them with + means OR. Because the output updates live, FILTER is useful for searchable lists and drill-down sheets without needing pivot tables or macros. It requires Microsoft 365 or Excel 2021.
13

Build a live leaderboard of the top 5 sales reps by total sales using dynamic array functions.

Save to ▾
Show answer
Get unique reps, total their sales, sort descending and take the top five: =LET(r,UNIQUE(Sales[Rep]), t,SUMIFS(Sales[Amount],Sales[Rep],r), TAKE(SORTBY(HSTACK(r,t),t,-1),5)) HSTACK puts names and totals side by side, SORTBY orders by totals, and TAKE keeps five rows. Without TAKE, use INDEX(...,SEQUENCE(5),{1,2}).
14

What are dynamic arrays and what causes a #SPILL! error?

Save to ▾
Show answer
In Microsoft 365, a formula can return many values that spill into nearby cells, as with UNIQUE, FILTER, SORT and SEQUENCE. Other formulas can refer to the whole result with the spill operator, for example =COUNTA(E2#). #SPILL! appears when the spill area is blocked by data, the formula sits inside a Table, the area overlaps merged cells, or the result would run past the sheet edge. Clear the blocking cells to fix it.
15

Your team wants lookups to show Not Found instead of #N/A for missing codes, without hiding genuine formula errors. How do you do it?

Save to ▾
Show answer
Use a function that only handles missing values, not every error: =XLOOKUP(A2, Codes[Code], Codes[Price], "Not Found") or =IFNA(VLOOKUP(A2, Codes, 2, FALSE), "Not Found"). Avoid IFERROR here, because it also hides #REF! or #VALUE! caused by broken ranges. Add =COUNTIF(D:D, "Not Found") at the top so missing codes are counted and followed up.
16

You need to reconcile a bank statement with the ledger and list entries missing from either side. How?

Save to ▾
Show answer
Create a common key, for example date plus amount plus cheque or UTR number. On each sheet add =IF(COUNTIFS(Other[Key],[@Key])=0,"Missing","Matched") and filter the Missing rows. Duplicated amounts need COUNTIFS on both sides so counts are compared, not just presence. For repeated monthly work, load both into Power Query and use Left Anti and Right Anti merges, which list unmatched rows directly.
17

How do you return all matching values for a lookup, not only the first?

Save to ▾
Show answer
In Microsoft 365, FILTER returns every match as a spilled list, and TEXTJOIN can join them into one cell: =FILTER(Orders[OrderID],Orders[Customer]=A2) =TEXTJOIN(", ",TRUE,FILTER(Orders[OrderID],Orders[Customer]=A2,"")) In older versions, use TEXTJOIN with IF as an array formula: =TEXTJOIN(", ",TRUE,IF(Orders[Customer]=A2,Orders[OrderID],""))
18

A sales file has employee names but the master list has employee IDs, and some names repeat. How do you join them safely?

Save to ▾
Show answer
Do not look up by name alone, because a duplicate name returns the first match and silently assigns sales to the wrong person. First flag duplicates in the master with COUNTIF(names,name)>1. Then build a composite key, such as name plus branch or name plus email, in both tables and look up on that. Rows still ambiguous should go back to the data owner for an ID rather than be guessed.
19

Get the latest price of each product from a transaction log sorted by date.

Save to ▾
Show answer
If the log is sorted oldest to newest, search from the bottom: =XLOOKUP(A2,Log[Product],Log[Price],,0,-1) If it is not sorted, find the latest date first and then match on both: =LET(d,MAXIFS(Log[Date],Log[Product],A2), XLOOKUP(1,(Log[Product]=A2)*(Log[Date]=d),Log[Price])) The second version is order-independent and safer for appended data.
20

Tell me about a time data from two teams did not match. How did you resolve it?

Save to ▾
Show answer
Situation: finance and sales reported different revenue for the same quarter. Task: find the gap before the review meeting. Action: I pulled both datasets, built a key on invoice number, and used lookups to list invoices present in only one file. Most of the gap came from credit notes that sales did not deduct and invoices booked on the last day. Result: both teams agreed a single definition and I added a reconciliation tab to the monthly pack.
21

Your manager asks you to replace all VLOOKUPs in a legacy workbook with XLOOKUP. How do you approach it?

Save to ▾
Show answer
First confirm everyone who opens the file has Microsoft 365 or Excel 2021, because older versions show #NAME? for XLOOKUP. Save a backup, list the VLOOKUPs using Find with Look in: Formulas, and replace them sheet by sheet, keeping an exact-match default. Compare key totals before and after, document the change in a notes sheet, and keep a version that still uses INDEX/MATCH if external clients need it.
22

How do you look up a value using multiple criteria, such as Employee ID and Month?

Save to ▾
Show answer
In Microsoft 365, multiply logical tests so only the row matching all conditions becomes 1: =XLOOKUP(1,(Pay[EmpID]=A2)*(Pay[Month]=B2),Pay[Salary],"Not found") In older Excel use INDEX/MATCH entered as an array formula (Ctrl+Shift+Enter): =INDEX(Pay[Salary],MATCH(1,(Pay[EmpID]=A2)*(Pay[Month]=B2),0)) For very large data a helper column joining ID and Month is faster.
23

Why is INDEX preferred over OFFSET for building dynamic ranges?

Save to ▾
Show answer
OFFSET is volatile, so it recalculates whenever anything changes, which slows big models. INDEX returns a reference too but is not volatile: OFFSET: =SUM(OFFSET($B$2,0,0,COUNTA($B:$B)-1,1)) INDEX: =SUM($B$2:INDEX($B:$B,COUNTA($B:$B))) Both sum a growing column, but the INDEX version only recalculates when column B changes. Converting the data to a Table is simpler still.
24

Lookups across 5 lakh rows make your workbook extremely slow. How do you speed it up?

Save to ▾
Show answer
Avoid repeating the same search: run one MATCH in a helper column and use several INDEX formulas on that position. Sort the lookup table and use XLOOKUP binary search (search_mode 2), which is much faster than a linear scan. Replace full-column references with Tables, set calculation to manual while editing, and for regular jobs move the join into Power Query or the Data Model with relationships.
25

When does binary search in XLOOKUP or approximate VLOOKUP give wrong results?

Save to ▾
Show answer
Binary search halves the range repeatedly, assuming the data is sorted. If the lookup column is unsorted, has mixed text and numbers or contains blanks, it can stop at the wrong row and return a plausible but incorrect value with no error. Use it only on data you sort in a controlled step, such as a Power Query output, and test a few values against an exact-match lookup.

Frequently asked questions

How important is Lookup and Dynamic Array Functions in Advanced Excel interviews?

VLOOKUP, INDEX/MATCH and XLOOKUP for fetching data across sheets, along with FILTER, SORT, UNIQUE and other dynamic array functions. Interviews test exact versus approximate match, multi-criteria and two-way lookups, why lookups return #N/A, reconciliation between two lists and keeping lookups fast on lakhs of rows.

How should I use the Lookup and Dynamic Array Functions sheet?

Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.