Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default vlookup part of string...

Hi All

Employee No.......................... Place
99440,994403,994404.............London
99442,994401,994405.............Manchester
994410..................................Leeds
994502..................................York

In above example hpw to vlookup part of string?
Each cell has multiple employee no. but i want to lookup single
employee no and it should return place.

e.g. If in above example if i vlookup "994403" then it should return
London

Can I do this?

vlookup function returning appropriate value for '994410' & '994502'
but not the rest!!

I tried FIND, SEARCH functions but these to functions are for single
cell and not for array... :(:(

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default vlookup part of string...

Hi

I entered Employee number in E1 then used
=IF(E1="","",INDEX(B:B,MATCH("*"&E1&"*",A:A,0)))

--
Regards
Roger Govier

wrote in message
...
Hi All

Employee No.......................... Place
99440,994403,994404.............London
99442,994401,994405.............Manchester
994410..................................Leeds
994502..................................York

In above example hpw to vlookup part of string?
Each cell has multiple employee no. but i want to lookup single
employee no and it should return place.

e.g. If in above example if i vlookup "994403" then it should return
London

Can I do this?

vlookup function returning appropriate value for '994410' & '994502'
but not the rest!!

I tried FIND, SEARCH functions but these to functions are for single
cell and not for array... :(:(

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default vlookup part of string...

You can use wildcards with VLOOKUP, so you could have:

=VLOOKUP("*"&C1&"*",A$2:B$5,2,0)

where C1 contains 994403.

Note that the table entries where there is a single employee number
(eg 994502) need to be text values in order to get an exact match.

Hope this helps.

Pete

On Oct 23, 12:46*pm, wrote:
Hi All

Employee No.......................... Place
99440,994403,994404.............London
99442,994401,994405.............Manchester
994410..................................Leeds
994502..................................York

In above example hpw to vlookup part of string?
Each cell has multiple employee no. but i want to lookup single
employee no and it should return place.

e.g. If in above example if i vlookup "994403" then it should return
London

Can I do this?

vlookup function returning appropriate value for '994410' & '994502'
but not the rest!!

I tried FIND, SEARCH functions but these to functions are for single
cell and not for array... :(:(

Thanks!


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default vlookup part of string...

On 23 Oct, 13:31, Pete_UK wrote:
You can use wildcards withVLOOKUP, so you could have:

=VLOOKUP("*"&C1&"*",A$2:B$5,2,0)

where C1 contains 994403.

Note that the table entries where there is a single employee number
(eg 994502) need to be text values in order to get an exact match.

Hope this helps.

Pete

On Oct 23, 12:46*pm, wrote:



Hi All


Employee No.......................... Place
99440,994403,994404.............London
99442,994401,994405.............Manchester
994410..................................Leeds
994502..................................York


In above example hpw tovlookuppartofstring?
Each cell has multiple employee no. but i want to lookup single
employee no and it should return place.


e.g. If in above example if ivlookup"994403" then it should return
London


Can I do this?


vlookupfunction returning appropriate value for '994410' & '994502'
but not the rest!!


I tried FIND, SEARCH functions but these to functions are for single
cell and not for array... :(:(


Thanks!- Hide quoted text -


- Show quoted text -



thanks Roger & Pete for the prompt reply.

It worked!! but as pointed out by Pete the single employee value
should be TEXT now how can i convert it to Text??

I tried TEXT function... but dont really understand wat shout I keep
'format text' parameter??

=TEXT(C1, ???)

or is there any other function to convert number to text?

Thanks again!!
Milind
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default vlookup part of string...

The simplest way is:

=A1&""

in a helper column and copy down.

Then highlight the column with this formula, click <copy then Edit | Paste
Special | Values (check) | OK then <Esc, which will fix the values. Then
you can copy these and paste over the original values.

Hope this helps.

Pete


wrote in message
...

thanks Roger & Pete for the prompt reply.

It worked!! but as pointed out by Pete the single employee value
should be TEXT now how can i convert it to Text??

I tried TEXT function... but dont really understand wat shout I keep
'format text' parameter??

=TEXT(C1, ???)

or is there any other function to convert number to text?

Thanks again!!
Milind




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default vlookup part of string...

Hi Pete

Thanks!!

But instead creating 1 more column I used to following formula...

= IF(ISERROR(INDEX($F$11:$F$20,MATCH("*"&A11&"*",$E$ 11:$E$20,0),1)),
INDEX($F$11:$F$20,MATCH(A11,$E$11:$E$20,0),1),INDE X($F$11:$F
$20,MATCH("*"&A11&"*",$E$11:$E$20,0),1))

Which is returning appropriate result.

Thanks a lot for all your inputs... you rock!!

--milind
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default vlookup part of string...

There are always several ways of doing things in Excel - I'm glad you
found a way that works for you, and thanks for feeding back.

The use of a helper column that I suggested earlier is only temporary
- once you fix the values and then paste them back to the original
column, you can delete the helper column.

Pete

On Oct 23, 4:45*pm, wrote:
Hi Pete

Thanks!!

But instead creating 1 more column I used to following formula...

= IF(ISERROR(INDEX($F$11:$F$20,MATCH("*"&A11&"*",$E$ 11:$E$20,0),1)),
INDEX($F$11:$F$20,MATCH(A11,$E$11:$E$20,0),1),INDE X($F$11:$F
$20,MATCH("*"&A11&"*",$E$11:$E$20,0),1))

Which is returning appropriate result.

Thanks a lot for all your inputs... you rock!!

--milind


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
delete a - if it is the last part of a string deb Excel Discussion (Misc queries) 1 September 21st 08 01:18 AM
Search/Match/Find ANY part of string to ANY part of Cell Value TWhizTom Excel Worksheet Functions 0 July 21st 08 08:16 PM
How do I use VLOOKUP to find part of string? niatpac Excel Worksheet Functions 3 July 19th 07 07:43 PM
Filter on first part of string Pat Excel Discussion (Misc queries) 6 September 9th 05 05:23 PM
Extract Part of String [email protected] Excel Worksheet Functions 1 June 9th 05 08:33 AM


All times are GMT +1. The time now is 01:46 AM.

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

About Us

"It's about Microsoft Excel"