Fix a VLOOKUP that fails on a space

Premium

The code in F2 was pasted from an email and ends with a space, so a plain VLOOKUP returns #N/A. In G2, look up the price with TRIM(F2) as the lookup value.

G2
ABCDEFGH
1Code Product Price Code Price
2A10 Pen 12 C30
3B20 Notebook 35
4C30 Stapler 89
5D40 Folder 24
6
7
8

Premium lesson

Unlock VLOOKUP and every other lesson

This is a premium lesson. Premium lets you solve it and every other lesson, take the timed mock tests, and earn certificates you can share on LinkedIn.

Next with premium:INDEX and MATCHXLOOKUP

It comes up in this mock test: Excel assessment (Indeed format)

Need help?