XLOOKUP Multiple Criteria — With Examples (Boolean Logic, Concatenation, OR)
Learn XLOOKUP with multiple criteria in Excel: Boolean logic, concatenation, helper columns and OR logic, with worked examples.
Read Guide →A normal formula points at a cell: =B2 means the value in B2. INDIRECT lets the address itself come from text — a cell address typed in a cell, a sheet name typed in a cell, or an address built piece by piece with a formula. You give it a text string like “B2”, and it turns that text into a real, working reference and returns what is in the cell. That is what makes a summary sheet possible: type the month name once, and every formula on the dashboard pulls from that month’s sheet. There is one cost to know up front: INDIRECT is volatile, which means it recalculates on every change, even when its own inputs have not changed. This guide teaches it in seven examples, all checked by hand — and it ends with the honest cases where a simpler function wins.
Quick takeaway: INDIRECT turns text into a reference.
=INDIRECT("B2") — the text “B2” becomes a real reference to cell B2.=INDIRECT("B"&D2) — build the address from parts: the letter B plus the row number in D2.=INDIRECT(A1&"!B2") — pull from the sheet whose name is in A1.
=INDIRECT(ref_text, [a1])
| Argument | Required? | What it does |
|---|---|---|
| ref_text | Yes | The reference written as text — “B2”, “B2:B5”, “Jan!B2”, or a named range |
| a1 | No | TRUE (or omitted) = the text is in normal A1 style. FALSE = the text is in R1C1 style |
The second argument is rarely needed — leave it out unless you work in R1C1 style, which almost nobody does. The first argument is the whole function: text in, reference out. If the text is not a valid reference, INDIRECT returns #REF!.
A small stock table. The main examples all run on it, so every result can be checked against the same numbers.
| A | B |
|---|---|
| Item | Units |
| Pens | 120 |
| Paper | 250 |
| Lamps | 400 |
The simplest case. Describe a cell as plain text, in quotes:
=INDIRECT("B2")
INDIRECT takes the text “B2”, reads it as an address, and returns what is actually in B2: 120. On its own this looks pointless — =B2 does the same thing with less typing. The point is what happens when the text stops being fixed, which is the next two examples.
Put the address in a cell as plain text, and let INDIRECT read it. D2 holds “B3”:
=INDIRECT(D2)
Result: 250 — the value in B3, which is the Paper row. Change D2 to “B4” and the result updates to 400, the value in B4. The formula never changes; only the text it reads changes. That is the whole idea: the address is data now, not part of the formula.
Join pieces of text with the ampersand & to assemble an address. Type a row number in D2 and have the formula fetch the units from that row automatically:
=INDIRECT("B"&D2)
With 4 in D2, the text “B” joins to the number 4 to build “B4”, and INDIRECT turns it into a reference to cell B4, returning 400. Change D2 to 3 and the result becomes 250. For an ordinary lookup by row position, INDEX is simpler and non-volatile — =INDEX(B2:B4, D2-1) does the same job without INDIRECT. Use INDIRECT here only when the address itself is the thing that varies, not just the row.
INDIRECT also works inside other functions. D2 holds a range written as text, “B2:B4”:
=SUM(INDIRECT(D2))
INDIRECT converts the text “B2:B4” into a real range, and SUM adds it up: 120 + 250 + 400 = 770. Change D2 to “B2:B3” and the total becomes 370. The range is data now — a user can type a different range without touching the formula.
This is the use that earns INDIRECT its keep: a summary dashboard with one sheet per month. A1 holds the month name, “Jan”. The January sheet’s B2 holds that month’s sales, 1,200:
=INDIRECT(A1&"!B2")
The formula builds the text “Jan!B2” — the sheet name from A1, an exclamation mark, and the cell — and returns 1,200. Change A1 to “Feb” and the same formula pulls from the February sheet. Every formula on the dashboard follows one typed word. If the sheet name has a space in it, wrap it in single quotes: =INDIRECT("'"&A1&"'!B2").
A normal reference follows its cell. Write =B2, then insert a row above row 2, and Excel rewrites the formula to =B3 — it follows the value. Sometimes you do not want that: the cell B2 itself is the thing that matters, not the value that was in it. INDIRECT does not follow:
=INDIRECT("B2")
Insert a row above row 2 and the formula still says “B2” — it now returns whatever is in the new B2. The text is fixed; the reference is not. That is a feature when the address is the contract, and a bug when it is not, so use it deliberately. For the everyday version of this problem — a cell that must stay fixed when you copy a formula down — the absolute reference guide is the right tool, not INDIRECT.
ADDRESS builds a text address from a row number and a column number, and INDIRECT turns it into a reference:
=INDIRECT(ADDRESS(3, 2))
ADDRESS(3, 2) builds the text “$B$3”. INDIRECT turns it into a live reference to B3, which holds 250 — the Paper row. This is the pattern for dashboards where both the row and the column come from cells: =INDIRECT(ADDRESS(F2, G2)) reads the row from F2 and the column from G2. For a plain lookup by position, INDEX is still simpler — this pattern earns its place only when the address is built from several moving parts.
| Situation | Use |
|---|---|
| The sheet name sits in a cell (a dashboard) | INDIRECT — nothing else does this |
| The address itself is built from parts | INDIRECT |
| The reference must not move when rows are inserted | INDIRECT with a text address |
| Dependent drop-down lists from named ranges | INDIRECT |
| A plain lookup by row number | INDEX — simpler, and not volatile |
| A lookup by value | XLOOKUP or VLOOKUP — see the Excel lookup functions topic page |
| A reference from another sheet, fixed | A normal reference — =Jan!B2 (a full guide on referencing another sheet is planned) |
INDIRECT is volatile: it recalculates whenever Excel recalculates, even if its own inputs have not changed. One INDIRECT in a dashboard is nothing. Hundreds of them in a big workbook make every edit slower, because every INDIRECT recalculates on every change. Two rules follow from that:
Excel also cannot trace INDIRECT’s dependencies the usual way, because the reference is text until calculation time. That means the auditing tools — Trace Precedents, Trace Dependents — do not follow it. Keep INDIRECT in a small number of places, where its job is visible, and the rest of the workbook stays fast and auditable.
| Mistake | What happens | Fix |
|---|---|---|
| The text is not a valid reference | #REF! | Check the text: “B2” is an address, “B 2” is not; a sheet name with a space needs single quotes |
| You forgot the quotes around the address | #NAME? — Excel reads B2 as a name, not text | Put the address in quotes: =INDIRECT("B2") |
| The sheet name has a space and no quotes | #REF! | Wrap it: =INDIRECT("'"&A1&"'!B2") |
| You used INDIRECT for a plain row lookup | It works, but it is slow and volatile for no reason | Use INDEX instead: =INDEX(B2:B4, D2-1) |
| You copied INDIRECT down a long column | The workbook slows on every edit | Use it in a few cells, not a thousand |
| The workbook it points to is closed | #REF! — INDIRECT cannot read a closed workbook | Keep the workbook open, or use a normal link instead |
| You expected Trace Precedents to follow it | Nothing happens — INDIRECT’s reference is text until calculation | Accept it, and keep INDIRECT in visible, documented places |
What does the INDIRECT function do in Excel? It turns a text string into a real cell reference. =INDIRECT("B2") returns the value in B2, and =INDIRECT(A1&"!B2") returns the value in B2 of the sheet named in A1.
What is the syntax of INDIRECT? =INDIRECT(ref_text, [a1]). ref_text is the reference written as text. a1 is optional: TRUE (or omitted) means the text is in normal A1 style, FALSE means R1C1 style.
How do I reference a sheet name from a cell? =INDIRECT(A1&"!B2"), where A1 holds the sheet name. Change A1 and the formula pulls from the new sheet. If the sheet name has a space, use =INDIRECT("'"&A1&"'!B2").
Why is my INDIRECT formula slow? INDIRECT is volatile — it recalculates on every change, even when its inputs have not changed. Use it in a few cells, not down a long column, and use INDEX for plain row lookups.
Why does INDIRECT return #REF!? The text is not a valid reference — a misspelled sheet name, a missing quote around a spaced sheet name, an address with a space in it, or a closed workbook it cannot read.
Can INDIRECT reference a closed workbook? No. INDIRECT returns #REF! for a closed workbook. Use a normal link to the workbook instead, or keep it open.
Should I use INDIRECT or INDEX? For a lookup by row number, use INDEX — it is simpler and not volatile. Use INDIRECT when the address itself comes from text, such as a sheet name in a cell.
That is INDIRECT: text in, reference out, and the one function that lets a sheet name or an address live in a cell instead of inside the formula. It is the right tool for dashboards, for addresses built from parts, and for references that must not move when rows are inserted — and the wrong tool for everything else, because it is volatile and untraceable. Use it where nothing else works, keep it in a few visible cells, and let INDEX, XLOOKUP and normal references do the everyday jobs. For the lookup side of this topic, the XLOOKUP function and the VLOOKUP formula are next, and the full learning order for the whole site is on the Excel Formulas hub.
Learn XLOOKUP with multiple criteria in Excel: Boolean logic, concatenation, helper columns and OR logic, with worked examples.
Read Guide →Learn the MATCH function in Excel: exact and approximate matches, wildcards, INDEX MATCH lookups, two-way lookups and XMATCH.
Read Guide →Learn the UNIQUE function in Excel: distinct values from a column, exactly once, sorted, blank-free, counted and combined.
Read Guide →