PC Review


Reply
Thread Tools Rate Thread

Approximate matches with vlookup?

 
 
Keith R
Guest
Posts: n/a
 
      30th Mar 2007
I have two worksheets, and I need to vlookup the values from the cells on
one worksheet against the other. The problem is that one or both of the
source and comparison values may have trailing spaces, so I thought trim
would be appropriate- something like:

=VLOOKUP(TRIM(C7),TRIM('revised date'!trimB5:G878),6,FALSE)

but that isn't working either. I suspect that most of the time I have one or
more char(32) on the end of the comparison value array cells, so I'm open to
any suggestions on how to ensure the match. Each number may have a different
number of digits or characters, so I can't just use left(8), for example.

Thanks for any ideas,
Keith



 
Reply With Quote
 
 
 
 
robotman@gmail.com
Guest
Posts: n/a
 
      30th Mar 2007
If there is a part of a field you can search for in the other sheet,
you can use the SEARCH function which lets you find a portion of a
string with in another and use wild characters...


 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      30th Mar 2007
>The problem is that one or both of the source and comparison values may
>have trailing spaces


Try this:

=VLOOKUP(TRIM(C7)&"*",'revised date'!B5:G878,6,0)

Biff

"Keith R" <fake_address@not_a_real_address.org.net.com> wrote in message
news:%(E-Mail Removed)...
>I have two worksheets, and I need to vlookup the values from the cells on
>one worksheet against the other. The problem is that one or both of the
>source and comparison values may have trailing spaces, so I thought trim
>would be appropriate- something like:
>
> =VLOOKUP(TRIM(C7),TRIM('revised date'!trimB5:G878),6,FALSE)
>
> but that isn't working either. I suspect that most of the time I have one
> or more char(32) on the end of the comparison value array cells, so I'm
> open to any suggestions on how to ensure the match. Each number may have a
> different number of digits or characters, so I can't just use left(8), for
> example.
>
> Thanks for any ideas,
> Keith
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
vlookup - find an alternative approximate match Graeme Microsoft Excel Worksheet Functions 4 16th Aug 2009 06:56 PM
VLOOKUP matches REJesser Microsoft Excel Misc 16 11th Nov 2008 12:41 AM
Vlookup Approximate Match Question =?Utf-8?B?Q3JhaWc=?= Microsoft Excel Worksheet Functions 4 21st Aug 2007 05:34 AM
vlookup #na's even though there are matches =?Utf-8?B?SmFuaXM=?= Microsoft Excel Misc 1 2nd Aug 2007 05:00 PM
Vlookup approximate match question. =?Utf-8?B?QmlsbA==?= Microsoft Excel Worksheet Functions 4 1st Sep 2006 08:44 PM


Features
 

Advertising
 

Newsgroups
 


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