+ Reply to Thread
Results 1 to 5 of 5

search 2 variables, return the correct one beside each match

  1. #1
    Registered User
    Join Date
    09-02-2016
    Location
    canada
    MS-Off Ver
    365
    Posts
    22

    search 2 variables, return the correct one beside each match

    hello,

    In column A:

    https://site.com/file/123H.png
    https://site.com/file/H456.png


    In column C:

    123H.png
    G132.png
    H456.png

    I want to scan/search all of both columns to find what's in column C within the http in column A, then return the correct variable in column C in column B (that matches what's in the column A variable)
    Last edited by JBeaucaire; 10-12-2016 at 02:24 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: search 2 variables, return the correct one beside each match

    Assuming that starts in A1 and C1, put this in B1 and copy down:

    =INDEX(A:A, MATCH("*"&C1,A:A, 0))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    09-02-2016
    Location
    canada
    MS-Off Ver
    365
    Posts
    22

    Re: search 2 variables, return the correct one beside each match

    Almost, didn't work because it's match column C one by one, it needs to scan all of column C:C to find the same in column A:A

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: search 2 variables, return the correct one beside each match

    If http format is constant before the last "/" then try

    in B1 and copy down

    =VLOOKUP(MID(A1,23,255),C:C,1,0)

    or


    =INDEX(C:C,MATCH(MID(A1,23,255),C:C,0))

  5. #5
    Registered User
    Join Date
    09-02-2016
    Location
    canada
    MS-Off Ver
    365
    Posts
    22

    Re: search 2 variables, return the correct one beside each match

    No

    Column A Column B Column C
    https://files/H11257PZ-01.png #N/A H11263P2-01ALT1.png
    https://files/H11257PZ-02.png #N/A H11263P2-02ALT1.png
    https://files/H11263P2-01.png #N/A H11263P2-03ALT1.png


    So need to find what's in column C to search in column A IF it's found in column A, return what's in column C in column B.

+ 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] Search for two variables and return a cell
    By Lynneth in forum Excel General
    Replies: 1
    Last Post: 08-17-2015, 08:51 AM
  2. [SOLVED] How to search for identical cell in columns and return the correct value
    By caooi23 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-15-2013, 11:33 AM
  3. Replies: 2
    Last Post: 04-28-2013, 05:55 PM
  4. Replies: 12
    Last Post: 03-29-2013, 03:02 PM
  5. Trying to return correct values using INDEX and MATCH
    By wayneknox01 in forum Excel General
    Replies: 2
    Last Post: 06-14-2012, 11:31 AM
  6. Search and return value to the left? Variables!
    By Crebsington in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2011, 01:32 PM
  7. [SOLVED] Using MATCH function does not return correct answer
    By LindaBabe54 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-31-2006, 09:58 AM

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