ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   using vlookup for words w/different indentation (https://www.excelbanter.com/excel-worksheet-functions/109678-using-vlookup-words-w-different-indentation.html)

HK

using vlookup for words w/different indentation
 
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.

Max

using vlookup for words w/different indentation
 
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 ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"HK" wrote in message
...
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.




Biff

using vlookup for words w/different indentation
 
looking for the *price* of an 'apple'

If the return value is numeric:

D1 = apple

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

Biff

"HK" wrote in message
...
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.




HK

using vlookup for words w/different indentation
 
Thanks for your input, guys.


"Biff" wrote:

looking for the *price* of an 'apple'


If the return value is numeric:

D1 = apple

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

Biff

"HK" wrote in message
...
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.






All times are GMT +1. The time now is 12:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com