LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Vlookup a text string

I should note that this is based on names where there is only one first name
like Bob. If there might be names with more than one first name like Mary
Beth, then this probably won't work unless the lookup table has each first
name in a separate cell also.

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Try something like this.

A1 = lookup_value

A1 = Lee, Robert E

Lookup table:

..........E..........F.........G..........H
1...Smith.......Sue...................10
2...Jones.......Joe........J..........22
3...Smith.......Tom......R.........15
4...Lee.........Robert...E..........60
5...Brown....Bill.........T..........20

Array entered** : (all on one line)

=INDEX(H$1:H$5,MATCH(SUBSTITUTE(LEFT(A1,
FIND(" ",A1&" ",FIND(",",A1)+2)-1),",",""),
E$1:E$5&" "&F$1:F$5,0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"Tim Nealon" wrote in message
...
I have two sets of employee data. The first is a download from our
payroll
system that gives each employees department number. The second is a
download
of our health insurance billing. I need to break the health insurance
bill
out to the various departments. The only field that is the "same" in
both
sets of data is the employee name.
Unfortunatley, the health insurnace bill has the name in one field as
"last
name, firstname middle initial". The payroll data breaks last name,
first
name, and middle initial into three separate fields.
I have concatenated the payroll data into one field and then copied -
paste
values so it is no longer a formula. I then tried to use vlookup
combined
with the trim function in case there were unwanted spaces, but no luck.
All
I can get is N/A.
Naturally, to further complicate matters, is sometimes the middle initial
appears in one set of data but not another. Also, we have several
employees
with the same last names so I can't just search by last name.
Any ideas on how to lookup this data so I can get the departments from
the
payroll data over to my health insurance data?

Thanks





 
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
vlookup and finding text string that's not an exact match my Excel Discussion (Misc queries) 4 July 31st 07 05:04 PM
Sumif text is contained winthin a longer text string in a cell Johnny M[_2_] Excel Worksheet Functions 3 March 21st 07 02:50 PM
Return a text string when the result of VLOOKUP formula is #N/A jeremy nickels Excel Worksheet Functions 2 August 4th 06 05:26 PM
Splitting a text string into string and number mcambrose Excel Discussion (Misc queries) 4 February 21st 06 03:47 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 09:56 PM


All times are GMT +1. The time now is 08:29 AM.

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"