+ Reply to Thread
Results 1 to 5 of 5

Use vlookup to lookup part of the lookup value in the array

  1. #1
    Registered User
    Join Date
    11-01-2011
    Location
    Twente, Nederland
    MS-Off Ver
    Excel Professional Plus 2019
    Posts
    40

    Question Use vlookup to lookup part of the lookup value in the array

    What if you would like to lookup a value and accept any values that are a part of the lookup value?

    I have a list of URLs and want to vlookup to see if the base url of these urls occurs in my lookup array.
    Example:
    Lookup value = www.somewebsite.com/category1/productX
    Array value = www.somewebsite.com

    So I want to know if the base url of www.somewebsite.com/category1/productX exists in my lookup array.
    How would I do that? I can't use wildcards in my lookup value, because by default any lookup value is longer than the corresponding array values.
    An additional problem is that the list of base url's in the array contain many different websites ending on .com, .de, .nl, .uk, .eu, etc...
    Maybe I could modify the lookup value inside the formula (strip it down to base url before looking up the match in the array) but I don't know how.

    Does anyone have an idea on how to solve this?

    Goal is a column next to the column with lookup values to tell me if the base url is in the array. So the formula should be in that column.
    Attached Files Attached Files
    carpe diem

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,423

    Re: Use vlookup to lookup part of the lookup value in the array

    One way:

    =IF(ISNA(MATCH(LEFT(A2,FIND(" ",SUBSTITUTE(A2,"/"," ",3))-1),'Array values'!$A$2:$A$43,0)),"Not ","")&"Present"

    =HVIS(ERIT(SAMMENLIGNE(VENSTRE(A2;FINN(" ";BYTT.UT(A2;"/";" ";3))-1);'Array values'!$A$2:$A$43;0));"Not ";"")&"Present"
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Use vlookup to lookup part of the lookup value in the array

    I'm not sure why you have marked the first URL as "present", as it is for "somewebsite1", but try this formula in B2:

    =IF(COUNTIF(A2,"*"&"somewebsite."&"*"),"present","not present")

    You may need to change the commas ( , ) to semicolons ( ; ) in the formula, depending on your regional settings. Copy the formula down as required.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    11-01-2011
    Location
    Twente, Nederland
    MS-Off Ver
    Excel Professional Plus 2019
    Posts
    40

    Re: Use vlookup to lookup part of the lookup value in the array

    I succeeded doing it with your proposed formula AliGW! Thanks!

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,423

    Re: Use vlookup to lookup part of the lookup value in the array

    You're welcome. Thanks for the rep.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Help with VLOOKUP - lookup value is a part of a string
    By TiberSeptim in forum Excel General
    Replies: 3
    Last Post: 04-14-2021, 12:30 AM
  2. Replies: 4
    Last Post: 04-25-2017, 11:01 AM
  3. Replies: 1
    Last Post: 11-19-2014, 03:09 PM
  4. Can I make the row lookup array/range part in an array formula variable?
    By OLLY-7 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-18-2014, 09:06 AM
  5. [SOLVED] Lookup question matching part of lookup value in the table array
    By kosmo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-05-2013, 11:07 AM
  6. Lookup on Part of Lookup Array
    By franciz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-21-2009, 08:32 AM
  7. Using Vlookup to lookup array, return array
    By jcampbell in forum Excel General
    Replies: 5
    Last Post: 11-16-2007, 01:13 PM

Tags for this Thread

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