ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   vlookup removing characters (https://www.excelbanter.com/excel-worksheet-functions/228381-vlookup-removing-characters.html)

Ryan

vlookup removing characters
 
I'm trying to lookup a value where my lookup_values contain extra text.

e.g.

lookup_values = "Los Angeles, CA TOTAL

the table array will have Los Angeles, CA but not the word "TOTAL"

so, i'm lost somewhere at the beginning of the function. I know that i need
to remove the last six characters from my lookup_value, i'm not sure how.

please help.

thanks!

Mike H

vlookup removing characters
 
Ryan.

Use the TRUE switch

=VLOOKUP("Los Angeles, CA TOTAL",$A$1:$B$17,2,TRUE)

or if your lookup value is in a cell (say) c1

=VLOOKUP(LEFT(C1,LEN(C1)-6),$A$1:$B$17,2,FALSE)

Mike



"ryan" wrote:

I'm trying to lookup a value where my lookup_values contain extra text.

e.g.

lookup_values = "Los Angeles, CA TOTAL

the table array will have Los Angeles, CA but not the word "TOTAL"

so, i'm lost somewhere at the beginning of the function. I know that i need
to remove the last six characters from my lookup_value, i'm not sure how.

please help.

thanks!


Ryan

vlookup removing characters
 
perfect!! I get scared of the TRUE switch, so I tend to avoid it, but the
second option works great.

thank you much!!

"Mike H" wrote:

Ryan.

Use the TRUE switch

=VLOOKUP("Los Angeles, CA TOTAL",$A$1:$B$17,2,TRUE)

or if your lookup value is in a cell (say) c1

=VLOOKUP(LEFT(C1,LEN(C1)-6),$A$1:$B$17,2,FALSE)

Mike



"ryan" wrote:

I'm trying to lookup a value where my lookup_values contain extra text.

e.g.

lookup_values = "Los Angeles, CA TOTAL

the table array will have Los Angeles, CA but not the word "TOTAL"

so, i'm lost somewhere at the beginning of the function. I know that i need
to remove the last six characters from my lookup_value, i'm not sure how.

please help.

thanks!



All times are GMT +1. The time now is 04:55 AM.

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