Skip to content

How to lookup to the left in Excel in Excel

Find a value in one column and return a value from a column to its left, using XLOOKUP or INDEX and MATCH, which VLOOKUP cannot do.

A staff list has the employee ID in column A and the name in column B. You have a name and need the ID. The ID is to the left of the name, and VLOOKUP cannot reach it.

VLOOKUP always searches the first column of its table and can only return from columns to the right. To look left you have two options, and neither needs the columns rearranged.

XLOOKUP takes the column to search and the column to return as separate arguments, so their order on the sheet does not matter:

=XLOOKUP(F2, B2:B9, A2:A9)

Search the Name column, return the ID column. That is the whole formula. It matches exactly by default, and its fourth argument controls what shows when nothing matches.

INDEX and MATCH have worked in every version for decades:

=INDEX(A2:A9, MATCH(F2, B2:B9, 0))

MATCH finds the position of the name in column B. INDEX returns the item at that position from column A. The 0 makes MATCH look for an exact match, and leaving it out is a classic source of wrong answers.

Both return the first match when a name appears twice. If names are not unique, look up on something that is, such as an ID, or add a second criterion.

You could also swap the columns, but that breaks other formulas that point at them. The Lookups track covers XLOOKUP, INDEX and MATCH, and when each one is the better choice.

2 ways to do it

1XLOOKUP

=XLOOKUP(F2,B2:B9,A2:A9)

  1. Type =XLOOKUP( then the value to find, F2.
  2. Select the column to search, B2:B9, then the column to return, A2:A9.
  3. Add a fourth argument such as "Not found" for names that are not in the list.

2INDEX and MATCH

=INDEX(A2:A9,MATCH(F2,B2:B9,0))

  1. MATCH(F2,B2:B9,0) gives the row position of the name, with 0 for an exact match.
  2. INDEX(A2:A9, position) returns the item from the ID column at that position.

Try it yourself

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In G2, return the employee ID for the name in F2. The ID column is to the left of the names.

Answer in G2.

G2
A
B
C
D
E
F
G
H
1
Employee ID
Name
Department
Name
Employee ID
2
E-1041
Hana Duarte
Finance
Imogen Marsh
3
E-1057
Owen Ferreira
Operations
Sam Reyes
4
E-1062
Mei Lindqvist
Sales
5
E-1078
Carlos Abara
Finance
6
E-1083
Imogen Marsh
People
7
E-1096
Dev Chaudhry
Operations
8
E-1104
Nadia Hughes
Sales
9
E-1119
Zoe Park
People

Learn it properly, one graded sheet at a time.

Logic and text covers this in lesson 14, TEXTSPLIT.