Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Lookup 'Like' values???

I have two s/sheets; one has many rows of data and I shall call thi
datasheet. The other is lookup table containing a column with 30 or s
values. Here is my problem:

I would like to be able to define a range consisting of the values i
one of the columns from the datasheet (which I can manage) and the
perform some kind of lookup/match/index to the lookup table. So what'
the problem? Seems straightforward enough?
The problem is that the values in the lookup table are partial values
For example, a value in the datasheet will be 'XPBARC' but th
'matching' value in the lookup table will just be 'XPBA'! Now, courtes
of Mr. Walkenbach, I have a user-defined function called ISLIKE whic
some of you may be familiar with? But although this works on comparin
two cell values I would prefer not to create a couple of loopin
structures to examine the values in each s/sheet (I also can't do i
anyway! ;-)) but would prefer, if possible, to use a lookup, o
similar, which should be quicker also?

So, if anybody could help I would be extremely grateful indeed!

Many thanks,

Adria

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Lookup 'Like' values???

Adria

Try the match function. If you sort the data in descending order then use MATCH with the -1 match type, you should get what you are chasing

Say you have the data XPBARE, XPBARD, XPBARC, X in the range A20:A23. The formula =MATCH("XPBA",A20:A23,-1) will come up with 3 which is the position of XPBARC. You can then use this with the INDEX function to find the associated required value

Ton

----- Kobayashi wrote: ----

I have two s/sheets; one has many rows of data and I shall call thi
datasheet. The other is lookup table containing a column with 30 or s
values. Here is my problem

I would like to be able to define a range consisting of the values i
one of the columns from the datasheet (which I can manage) and the
perform some kind of lookup/match/index to the lookup table. So what'
the problem? Seems straightforward enough
The problem is that the values in the lookup table are partial values
For example, a value in the datasheet will be 'XPBARC' but th
'matching' value in the lookup table will just be 'XPBA'! Now, courtes
of Mr. Walkenbach, I have a user-defined function called ISLIKE whic
some of you may be familiar with? But although this works on comparin
two cell values I would prefer not to create a couple of loopin
structures to examine the values in each s/sheet (I also can't do i
anyway! ;-)) but would prefer, if possible, to use a lookup, o
similar, which should be quicker also

So, if anybody could help I would be extremely grateful indeed

Many thanks

Adria


--
Message posted from http://www.ExcelForum.com


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Lookup 'Like' values???

Tony,

Many thanks for your help! However, I wish to define and use ranges.
also wish to use this funciton in code, so:

Can I put a range in the below formula to replace the "XPBA" part? O
will I have to use some kind of loop through each of the lookup cells?

=MATCH("XPBA",A20:A23,-1)

Currently I have:

With myRange
For i = 4 To .Rows.Count
If ISLIKE(.Cells(i, 4) & "*", rngB(1, 1)) = True Then
MsgBox "true"
Else: MsgBox "false" '.Cells(i, 4).Select
End If
Next i
End With

This seems to kind of work except that I have to add the (1,1) to th
range which kind of defeats the purpose. Should I scap this altogethe
(if I'm going in the wrong direction?) of should I replace the ISLIK
function with the Match function you have kindly provided?

Regards,

Adria

--
Message posted from http://www.ExcelForum.com

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
i wish to lookup values in column A, & add adjacent values in colu Browny Excel Discussion (Misc queries) 4 September 26th 08 05:00 PM
Lookup with two lookup values KimC Excel Discussion (Misc queries) 1 September 1st 08 04:05 AM
How do I use LOOKUP to return a range of values, then SUM values? irvine79 Excel Worksheet Functions 5 August 4th 06 01:33 PM
Advanced Lookup (lookup for 2 values) 0-0 Wai Wai ^-^ Excel Worksheet Functions 2 March 30th 06 07:09 PM
How do I lookup and return different values when the lookup value. kg Excel Discussion (Misc queries) 1 January 20th 05 12:53 AM


All times are GMT +1. The time now is 12:00 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"