Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default VLOOKUP with value contained within text

Can someone please help.

I am trying to perform a vlookup where the value is contained within the
text of the cell and there is no common pattern as to where the value starts
(eg could start in position 1 or 25)

An example:

The value is contained within the following cell in "Sheet 1" - A/C
M98603521 GOLDMAN SACH


Within the array in "Sheet 2"

Column A Column B
GOLDMAN SACH GOLSAC1012
....
....

I would like to lookup A/C M98603521 GOLDMAN SACH and return GOLSAC1012.

Thanks

Dan





  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default VLOOKUP with value contained within text

Try one of these:

=LOOKUP(2,1/((ISNUMBER(SEARCH(Sheet2!A$1:A$10,A1)))*(Sheet2!A$ 1:A$10<"")),Sheet2!B$1:B$10)

=INDEX(Sheet2!B$1:B$10,MATCH(1,INDEX((ISNUMBER(SEA RCH(Sheet2!A$1:A$10,A1)))*(Sheet2!A$1:A$10<""),,1 ),0))

If your table on sheet2 will not have any empty cells we can shorten each
formula a little:

=LOOKUP(2,1/ISNUMBER(SEARCH(Sheet2!A$1:A$10,A1)),Sheet2!B$1:B$ 10)

=INDEX(Sheet2!B$1:B$10,MATCH(1,INDEX(--(ISNUMBER(SEARCH(Sheet2!A$1:A$10,A1))),,1),0))

Biff

"Farns" wrote in message
...
Can someone please help.

I am trying to perform a vlookup where the value is contained within the
text of the cell and there is no common pattern as to where the value
starts
(eg could start in position 1 or 25)

An example:

The value is contained within the following cell in "Sheet 1" - A/C
M98603521 GOLDMAN SACH


Within the array in "Sheet 2"

Column A Column B
GOLDMAN SACH GOLSAC1012
...
...

I would like to lookup A/C M98603521 GOLDMAN SACH and return
GOLSAC1012.

Thanks

Dan







  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 340
Default VLOOKUP with value contained within text

The formula for the last match in the list can be shortened a little:

=LOOKUP(2,1/SEARCH(Sheet2!A$1:A$10,A2)/(Sheet2!A$1:A$10<""),Sheet2!B
$1:B$10)

or without blanks:

=LOOKUP(9^9,SEARCH(Sheet2!A$1:A$10,A2),Sheet2!B$1: B$10)

You could also add in the first line of sheet1 the return value when
the match is not found:

A B
* Not found
A/C M98603521 GOLDMAN SACH
.....

On 12 Mar, 02:30, "T. Valko" wrote:
Try one of these:

=LOOKUP(2,1/((ISNUMBER(SEARCH(Sheet2!A$1:A$10,A1)))*(Sheet2!A$ 1:A$10<"")),*Sheet2!B$1:B$10)

=INDEX(Sheet2!B$1:B$10,MATCH(1,INDEX((ISNUMBER(SEA RCH(Sheet2!A$1:A$10,A1)))**(Sheet2!A$1:A$10<""),, 1),0))

If your table on sheet2 will not have any empty cells we can shorten each
formula a little:

=LOOKUP(2,1/ISNUMBER(SEARCH(Sheet2!A$1:A$10,A1)),Sheet2!B$1:B$ 10)

=INDEX(Sheet2!B$1:B$10,MATCH(1,INDEX(--(ISNUMBER(SEARCH(Sheet2!A$1:A$10,A1)*)),,1),0))

Biff

"Farns" wrote in message

...



Can someone please help.


I am trying to perform a vlookup where the value is contained within the
text of the cell and there is no common pattern as to where the value
starts
(eg could start in position 1 or 25)


An example:


The value is contained within the following cell in "Sheet 1" - A/C
M98603521 GOLDMAN SACH


Within the array in "Sheet 2"


Column A Column B
GOLDMAN SACH GOLSAC1012
...
...


I would like to lookup A/C M98603521 GOLDMAN SACH and return
GOLSAC1012.


Thanks


Dan- Hide quoted text -


- Show quoted text -



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default VLOOKUP with value contained within text

Thank you both very much.

Dan


"Lori" wrote:

The formula for the last match in the list can be shortened a little:

=LOOKUP(2,1/SEARCH(Sheet2!A$1:A$10,A2)/(Sheet2!A$1:A$10<""),Sheet2!B
$1:B$10)

or without blanks:

=LOOKUP(9^9,SEARCH(Sheet2!A$1:A$10,A2),Sheet2!B$1: B$10)

You could also add in the first line of sheet1 the return value when
the match is not found:

A B
* Not found
A/C M98603521 GOLDMAN SACH
.....

On 12 Mar, 02:30, "T. Valko" wrote:
Try one of these:

=LOOKUP(2,1/((ISNUMBER(SEARCH(Sheet2!A$1:A$10,A1)))*(Sheet2!A$ 1:A$10<"")),-Sheet2!B$1:B$10)

=INDEX(Sheet2!B$1:B$10,MATCH(1,INDEX((ISNUMBER(SEA RCH(Sheet2!A$1:A$10,A1)))-*(Sheet2!A$1:A$10<""),,1),0))

If your table on sheet2 will not have any empty cells we can shorten each
formula a little:

=LOOKUP(2,1/ISNUMBER(SEARCH(Sheet2!A$1:A$10,A1)),Sheet2!B$1:B$ 10)

=INDEX(Sheet2!B$1:B$10,MATCH(1,INDEX(--(ISNUMBER(SEARCH(Sheet2!A$1:A$10,A1)-)),,1),0))

Biff

"Farns" wrote in message

...



Can someone please help.


I am trying to perform a vlookup where the value is contained within the
text of the cell and there is no common pattern as to where the value
starts
(eg could start in position 1 or 25)


An example:


The value is contained within the following cell in "Sheet 1" - A/C
M98603521 GOLDMAN SACH


Within the array in "Sheet 2"


Column A Column B
GOLDMAN SACH GOLSAC1012
...
...


I would like to lookup A/C M98603521 GOLDMAN SACH and return
GOLSAC1012.


Thanks


Dan- Hide quoted text -


- Show quoted text -




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find partial text contained in another cell Jim G Excel Discussion (Misc queries) 1 December 11th 06 12:59 AM
When I import a csv file text that contained a + gets scrambled HartfordBA Excel Discussion (Misc queries) 0 January 5th 06 01:43 PM
Countif function for instances of text string contained Garbunkel Excel Worksheet Functions 1 October 11th 05 08:09 AM
Vlookup for data contained in a cell Garbunkel Excel Worksheet Functions 5 September 14th 05 06:47 PM
searching a cell for a contained text word Doug K Charts and Charting in Excel 0 June 20th 05 09:10 PM


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"