A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Vlookup variation



 
 
Thread Tools Display Modes
  #1  
Old June 20th, 2004, 06:02 PM
Yandros
external usenet poster
 
Posts: n/a
Default Vlookup variation

Hi All,

The Vlookup function normally looks for exact matches.

However I'd like to try and modify the functionality to
look for near matches. For example if I have a two tables
of numbers of where the lengths vary I want to find if
one number appears within another and make a columns
selection based on that.

For example if 447385 exists in array and I have
4473854568 as the lookup up value I only want it to
consider the first few digit (from left to right) which
equal the value in the array.

Is this possible? I have tried :-

Vlookup(right(A2,6),mgt,3,true)

Where A2 is the cell of the value to lookup,
Where MGT is the array (made up of three columns)

Unfortunately it doesn't work even when both sets of
values are sorted numerically on the first column. Beside
which the length of 6 characters can change for each of
the values to be looked up.

I need a query that will examine each value to be looked
up count the number of digits, then look in the array for
the matching digits (ignoring any additional digits after
the intial match in digits is found).

Hope this make sense to someone. Any suggestions would be
gratefully received.

Thanks in advance.

Yandros
  #2  
Old June 20th, 2004, 08:09 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default Vlookup variation

The fact that you're asking about VLookup, combined with your sample code,
leads me to believe you're dealing with Excel. I'd suggest asking your
question in a newsgroup related to Excel. (There are lots starting
microsoft.public.excel)

This newsgroup is for questions about queries in Access, the database
product that's part of Office Professional.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Yandros" wrote in message
...
Hi All,

The Vlookup function normally looks for exact matches.

However I'd like to try and modify the functionality to
look for near matches. For example if I have a two tables
of numbers of where the lengths vary I want to find if
one number appears within another and make a columns
selection based on that.

For example if 447385 exists in array and I have
4473854568 as the lookup up value I only want it to
consider the first few digit (from left to right) which
equal the value in the array.

Is this possible? I have tried :-

Vlookup(right(A2,6),mgt,3,true)

Where A2 is the cell of the value to lookup,
Where MGT is the array (made up of three columns)

Unfortunately it doesn't work even when both sets of
values are sorted numerically on the first column. Beside
which the length of 6 characters can change for each of
the values to be looked up.

I need a query that will examine each value to be looked
up count the number of digits, then look in the array for
the matching digits (ignoring any additional digits after
the intial match in digits is found).

Hope this make sense to someone. Any suggestions would be
gratefully received.

Thanks in advance.

Yandros



  #3  
Old June 20th, 2004, 10:35 PM
Yandros
external usenet poster
 
Posts: n/a
Default Vlookup variation

Douglas,

You are indeed correct. I realised my mistake about 5
minutes after posting the message.

I have subsequently posted it in the excel newsgroup.

Thanks for taking the time to respond.

Yandros

-----Original Message-----
The fact that you're asking about VLookup, combined with

your sample code,
leads me to believe you're dealing with Excel. I'd

suggest asking your
question in a newsgroup related to Excel. (There are

lots starting
microsoft.public.excel)

This newsgroup is for questions about queries in Access,

the database
product that's part of Office Professional.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Yandros" wrote in

message
...
Hi All,

The Vlookup function normally looks for exact matches.

However I'd like to try and modify the functionality to
look for near matches. For example if I have a two

tables
of numbers of where the lengths vary I want to find if
one number appears within another and make a columns
selection based on that.

For example if 447385 exists in array and I have
4473854568 as the lookup up value I only want it to
consider the first few digit (from left to right) which
equal the value in the array.

Is this possible? I have tried :-

Vlookup(right(A2,6),mgt,3,true)

Where A2 is the cell of the value to lookup,
Where MGT is the array (made up of three columns)

Unfortunately it doesn't work even when both sets of
values are sorted numerically on the first column.

Beside
which the length of 6 characters can change for each of
the values to be looked up.

I need a query that will examine each value to be

looked
up count the number of digits, then look in the array

for
the matching digits (ignoring any additional digits

after
the intial match in digits is found).

Hope this make sense to someone. Any suggestions would

be
gratefully received.

Thanks in advance.

Yandros



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:10 PM.


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