using vlookup for words w/different indentation

H

HK

Hi,
I'm trying figure out a way to use a vlookup function when the word in the
table is the same but indented differently. For instance, you're looking for
the price of an 'apple' but the word 'apple' in the table is actually written
' apple' with 4 spaces in front of the word.

I was trying to use the 'Right' function but the number of letters my vary.
Thanks for your inputs.
 
M

Max

This might suffice, where we append 4 spaces in front of the lookup value in
A1 to make it consistent with the table array's lookup col :

In say, B1: =VLOOKUP(" "&TRIM(A1),E:F,2,0)

Adapt to suit ..
 
B

Biff

looking for the *price* of an 'apple'

If the return value is numeric:

D1 = apple

=SUMIF(A1:A10,"*"&D1,B1:B10)

Biff
 
Top