XLOOKUP With Multiple Criteria in Different Columns

Matching fields that aren't sitting next to each other

Multi-criteria matching gets more complicated when the fields you need to match on aren't adjacent columns - for example, an ID in column A and a status flag in column F, with several unrelated columns in between. The boolean array technique still works here, but it requires care to make sure each comparison points at the correct column pair without accidentally shifting rows.

This page walks through matching non-adjacent columns with XLOOKUP, and then shows how Turbo Excel Lookup handles the same scenario since it selects columns by name rather than by position.

Turbo Excel Lookup

Turbo Excel Lookup
App Screenshots
Lookup and Merge tab - VLOOKUP XLOOKUP replacement
Match mode and return option selection
Lookup statistics and match percentage report
Join tab - Left Right Inner Full Outer Anti Semi Cross join
Duplicates tab - duplicate record finder
Data Cleaning tab - trim normalize and clean columns
Formula Generator tab - VLOOKUP XLOOKUP INDEX MATCH formula builder
Reports tab - session log of lookups joins and exports
Export options - XLSX CSV TSV output settings
Key Column Pairs - multi-key composite matching setup
License activation screen - Gumroad key entry
Help tab - built-in usage guide and tips
Enlarged application screenshot
Matching Non-Adjacent Columns
=XLOOKUP(1, (Data!A:A=A2)*(Data!F:F=F2), Data!C:C, "No match")

The formula structure is the same as a standard multi-criteria XLOOKUP, but note that column A and column F are referenced directly rather than as one continuous range - there's no need to include columns B through E just because they sit between the two criteria columns. This is one advantage XLOOKUP has over VLOOKUP-based multi-criteria approaches, which typically require a helper column combining adjacent fields.

A Common Mistake With This Layout

A frequent error is referencing full-column ranges (A:A, F:F) that include header rows or unrelated data further down the sheet, which can produce false-positive matches if a blank cell in column A happens to equal a blank cell in the comparison. It's safer to use bounded ranges like A2:A5000 and F2:F5000 that match the actual extent of your data, adjusting the bounds if the dataset grows.

Selecting Columns by Name Instead of Position

Turbo Excel Lookup's Key Column Pairs are built by selecting a column name from a dropdown populated with your file's actual headers, so whether the two fields you're matching on sit next to each other or on opposite sides of the sheet makes no difference to how the match is configured. There's no risk of accidentally including an unrelated column in between, since each pair only ever references the two specific columns you selected.

Documenting Which Columns Are Being Compared

When criteria columns are spread far apart in a wide sheet, it's easy to lose track of exactly which columns a formula is comparing, especially months later. A brief note near the formula, or in a dedicated notes column, listing the two column headers being matched (e.g. "Matches column A [Order ID] to column F [Status]") saves time for anyone auditing the sheet later, since the formula itself only shows column letters, not header names.

This is one area where Turbo Excel Lookup's interface is inherently self-documenting - because Key Column Pairs are built by selecting actual header names from a dropdown rather than column letters, reopening a saved lookup configuration immediately shows which fields were matched, without needing a separate note.

A Layout Habit That Prevents Confusion Later

If you're designing a new sheet from scratch rather than working with an existing export, grouping related criteria columns near each other - even if they don't strictly need to be adjacent for the formula to work - makes the sheet considerably easier to read and audit later, both for formulas and for anyone reviewing the raw data directly.

Confirming Column References Survive a Sort

Sorting a sheet by a different column after a multi-criteria formula has been built doesn't break cell-reference-based formulas, since Excel automatically adjusts references when rows are reordered through a sort. It's still worth re-verifying formula results after a significant sort or filter operation, though, simply as a general habit, since a sort combined with a partially selected range can occasionally produce unexpected results if the selection wasn't fully inclusive beforehand.

The Bottom Line

Non-adjacent criteria columns don't add any real difficulty to XLOOKUP's boolean array technique - the formula structure stays the same regardless of how far apart the relevant columns sit. The main risk is losing track of which columns are actually being compared as the sheet grows wider.

One More Practical Note

A final practical habit worth adopting is reviewing the full list of criteria columns involved in a formula periodically, especially in a sheet that's grown wider over time, simply to confirm every referenced column still holds the kind of data the formula was originally built to expect.

Frequently Asked Questions

Does it matter how far apart the two criteria columns are?

No, XLOOKUP's boolean array technique works the same regardless of column distance, since each comparison array is built independently.

Why should I avoid full-column references like A:A?

Full-column references include every row in the sheet, including blank rows, which can occasionally produce unintended matches between two blank cells if your bounded data range isn't clearly defined.

What's a safer range reference to use instead?

A bounded range matching your actual data extent, such as A2:A5000, avoids the blank-cell matching issue while still covering enough rows for future growth.

Does column position matter when using Turbo Excel Lookup?

No, columns are selected by their header name from a dropdown, so their physical position in the spreadsheet has no effect on how a Key Column Pair is configured.

Why is it easy to lose track of which columns a formula references?

Because formulas reference column letters rather than header names, and in a wide sheet with many columns, it's easy to forget what a given letter actually represents months later.

Does Turbo Excel Lookup show column names instead of letters?

Yes, Key Column Pairs are built and displayed using each column's actual header text, making the matched fields clear without cross-referencing back to the sheet.

Is there a layout habit that prevents confusion with non-adjacent criteria columns?

Grouping related criteria columns near each other when designing a new sheet, even though the formula doesn't require adjacency, makes the sheet easier to read and audit later.

Does sorting a sheet break formulas that reference specific columns?

No, Excel automatically adjusts cell references when rows are reordered through a sort, though it's still worth re-verifying results afterward as a general habit.

Ready to stop fighting #N/A errors and match your spreadsheets visually?

Related guides and tools

This guide is part of TurboSoft’s Excel lookup and matching resources. Turbo Excel Lookup handles all of these tasks offline on Windows.

Get Turbo Excel Lookup →