How to Use VLOOKUP in Excel Across Two Sheets

Excel for Windows / Mac / Web08:28 video7 copy-paste formulasFree .xlsx included
Orders!C2
=VLOOKUP(A2,Products!$A$2:$C$4,2,FALSE)

Enter this formula in Orders!C2 to return a product name from another sheet. Excel finds the code from A2 in the first column of the Products table and returns the name on the same row. With P205 in A2, the result is Wireless Mouse.

Interactive checkpoint · F4 lock

The fixed range Products!$A$2:$C$4 still includes P101.

C4 → Folder ✓

Download the VLOOKUP practice workbook (.xlsx). Open Orders and leave Solution for the end. The green cells in C2:C5 are yours to fill.

Build your first VLOOKUP on one sheet

On Orders, the order codes are in column A. A small copy of the catalog sits alongside them in E2:G4.

Code (E)Name (F)Unit price (G)
P101Folder$8.00
P205Wireless Mouse$79.00
P310Laptop Stand$45.00

Click C2, enter this formula, and press Enter.

=VLOOKUP(A2,E2:G4,2,FALSE)

Read the four arguments from left to right. A2 holds the order code. E2:G4 is the table Excel searches. 2 returns the second column within that table, which is F even though F is the sixth column on the sheet. FALSE requires an exact match. You can trace the answer with your finger. Find P205 in E3 and move right to F3 for Wireless Mouse.

Look up a value on another sheet

Open Products. It contains the same three records, with codes in column A, names in B, and prices in C. Back in Orders!C2, replace the first formula with this one.

=VLOOKUP(A2,Products!A2:C4,2,FALSE)

The first A2 belongs to Orders. The exclamation mark ties the lookup range A2:C4 to Products. Notice that P205 is on row 2 in Orders and row 3 in Products. The shared code connects the rows even when the two sheets are in different orders.

Lock the lookup range before filling down

Drag the fill handle from C2 through C5. C3 returns Laptop Stand, but C4 returns #N/A for P101. Click C4 and inspect the formula bar. The lookup range has shifted to Products!A4:C6. The record for P101 sits above it in row 2.

In C2, select A2:C4 inside the formula and press F4 in Windows Excel or Command+T in Excel for Mac. You can also type the dollar signs. Enter the following formula and fill down again.

=VLOOKUP(A2,Products!$A$2:$C$4,2,FALSE)

The reference to the order code moves from A2 to A3 and A4. The catalog stays fixed. The first three answers should now be Wireless Mouse, Laptop Stand, and Folder. The fourth order has a different problem.

Fix a VLOOKUP that still returns #N/A

Cells A2 and A5 both appear to contain P205. The code in A5 came from an email and has a trailing space. Try =LEN(A2) and =LEN(A5) in two empty cells. The lengths are 4 and 5. To remove ordinary leading and trailing spaces while looking up the code, enter this in C5.

=VLOOKUP(TRIM(A5),Products!$A$2:$C$4,2,FALSE)

C5 now returns Wireless Mouse. This formula cleans the order code. If the spaces are in your catalog, clean the catalog codes before looking them up.

Diagnose a price or a wrong product name

A price appears in the name column

Replace the value in A5 with a clean P205. In C5, try =VLOOKUP(A5,Products!$A$2:$C$4,3,FALSE). It returns 79, the unit price. Within the selected table, Code is column 1, Name is 2, and Unit Price is 3. Change the third argument back to 2 to return the name.

A missing code returns a real product

Change A5 to P206. The catalog jumps from P205 to P310. An exact lookup returns #N/A. Try omitting the last argument and compare the result.

=VLOOKUP(A5,Products!$A$2:$C$4,2)

Excel switches to approximate matching. In this ascending catalog, the largest code below P206 is P205, so the formula returns Wireless Mouse for an order the catalog cannot identify. Keep FALSE for exact product codes. An exact lookup works with an unsorted catalog too.

Show “Not Found” for a missing product

Leave P206 in A5. Once you have checked the range, the column number, and exact matching, use IFERROR to label the missing entry in C5.

=IFERROR(VLOOKUP(A5,Products!$A$2:$C$4,2,FALSE),"Not Found")

Your four results should now read Wireless Mouse, Laptop Stand, Folder, and Not Found. Compare them with Solution. IFERROR also catches errors such as #REF!, so inspect the original lookup if an existing product starts showing the fallback. When you add products below row 4, extend the locked range to include them.

Follow the same orders on screen in Excel Go’s VLOOKUP walkthrough on YouTube (8:28). For the full argument definitions, see Microsoft’s VLOOKUP function reference.