+ Reply to Thread
Results 1 to 3 of 3

Vlookup search within a cell if the lookup_value is not in the same order as the arr

  1. #1
    Registered User
    Join Date
    09-10-2007
    Posts
    40

    Vlookup search within a cell if the lookup_value is not in the same order as the arr

    Hello,

    I am wondering if it is possible to have Vlookup search within a cell if the lookup_value is not in the same order as the array value. For example.

    Lookup_value = Foodworks Aroona
    Array Value = Aroona Foodworks.

    Is it possible for the vlookup to find the array value by manipulating the formula somewhat.

    Thanks for your help.

  2. #2
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Hi,

    If you have heaps of similar things that need to be allowed for it may be easier to redo one of your lists but...
    I had a play & although it's not pretty the below seemed to work for your specific example (ie for 2 word names separated by a space) by using wildcards in the lookup value, and checking that both lookups give the same result (it's not bulletproof but it may be rough enough for your needs).

    1)
    in cell B3 type:
    =VLOOKUP("*"&LEFT(A3,FIND(" ",A3,1)-1)&"*",$A$12:$B$17,1,FALSE)
    in cell C3
    =IF(B3=VLOOKUP("*"&MID(A3,FIND(" ",A3,1)+1,LEN(A3)-FIND(" ",A3,1)+1)&"*",$A$12:$B$17,1,FALSE),B3,"no match")

    2)
    or in a single cell but this may be harder/slower on the system if you are using a lot of vlookups:
    =IF(VLOOKUP("*"&LEFT(A3,FIND(" ",A3,1)-1)&"*",$A$12:$B$17,1,FALSE)=VLOOKUP("*"&MID(A3,FIND(" ",A3,1)+1,LEN(A3)-FIND(" ",A3,1)+1)&"*",$A$12:$B$17,1,FALSE),VLOOKUP("*"&LEFT(A3,FIND(" ",A3,1)-1)&"*",$A$12:$B$17,1,FALSE),"no match")

    To lookup other columns just change the bold "1" in option 2.
    the comparison check between the two vlookups could use a different column in either of the options but I am assuming that there is less likely to be results found in the Names column than there may be in other columns.

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Is it always a case of just swapping two words separated by a space?

    If so then with lookup_value in A1 this formula will swap the two words

    =MID(A1&" "&A1,FIND(" ",A1)+1,LEN(A1))

    If you want you can use this directly in a VLOOKUP something like

    =VLOOKUP(MID(A1&" "&A1,FIND(" ",A1)+1,LEN(A1)),B2:D100,2,0)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1