+ Reply to Thread
Results 1 to 9 of 9

VLOOKUPS, MID, AND FIND Together Returning Last Cell in Array

  1. #1
    Registered User
    Join Date
    12-05-2015
    Location
    Nashville, Tennessee
    MS-Off Ver
    MS Office 2010
    Posts
    4

    VLOOKUPS, MID, AND FIND Together Returning Last Cell in Array

    Hello,

    I'm new to the site, so thank you in advance for your help.

    I've got a workbook that I'm not allowed to share, and I'm trying to match some data from one worksheet to another.

    On Worksheet1, I have 40,000 entries that contain information about advertisements for 49 different url addresses, each with a unique identifier embedded in the url. On Worksheet2, I have the 49 url addresses and the respective advertising campaigns that each belongs to (e.g. "Ad Campaign 1, Ad Campaign 2, ...)

    I am trying to show which campaign each of the 40,000 ads/url's belongs to. I used a combination of MID & FIND to extract the unique identifier. I did this because each url was a different length, plus the ID was always followed by "|" and contained eight characters (text and numbers).

    Next, in Worksheet1 I tried to use =VLOOKUPS(L22,'Worksheet2'!A2:B50,1,FALSE)

    L22 is a cell that contains the MID & FIND formulas to parse the unique identifier from the url in the same row.

    For some reason, the FALSE in my VLOOKUPS never returned anything, but the TRUE would return the last cell in the array. Please help!! I've searched the web and asked everyone I know.

    Thank you!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: VLOOKUPS, MID, AND FIND Together Returning Last Cell in Array

    Hi, welcome to the forum

    FALSE is looking for an exact match, while TRUE assumes a sorted list, and it will return the next-closest match when it cannot find an exact match.

    Does what is in L22 actually exist in A2:A50?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: VLOOKUPS, MID, AND FIND Together Returning Last Cell in Array

    If the values in column A are not sorted in ascending order, which is necessary with that last true/false argument. Try using index-match:

    =INDEX('Worksheet2'!$B$2:$B$50,MATCH(L22,$A$2:$A$50,0))

    (look for L22 in column A and return the corresponding value from column B)

    If this doesn't work, post a short exemplary workbook or give more detail about how your data is organized.

  4. #4
    Registered User
    Join Date
    12-05-2015
    Location
    Nashville, Tennessee
    MS-Off Ver
    MS Office 2010
    Posts
    4

    Re: VLOOKUPS, MID, AND FIND Together Returning Last Cell in Array

    Hey! Thanks for the response. I'm trying to get and exact match. It does exist, but I think it might be confused, because I am extracting the ID from the URL's with MID functions in the array i'm trying to match, and in Column L.

  5. #5
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: VLOOKUPS, MID, AND FIND Together Returning Last Cell in Array

    So my formula doesn't work? It will be hard to assist further without seeing a workbook.

  6. #6
    Registered User
    Join Date
    12-05-2015
    Location
    Nashville, Tennessee
    MS-Off Ver
    MS Office 2010
    Posts
    4

    Re: VLOOKUPS, MID, AND FIND Together Returning Last Cell in Array

    Here are screenshots of what's going on. Sorry, I got carried away trying to hide the sensitive data
    Attached Images Attached Images

  7. #7
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: VLOOKUPS, MID, AND FIND Together Returning Last Cell in Array

    So you want values from the Campaign column on Analysis to go to the Campaign column on Table?

    =INDEX('Excel Table'!$A$2:$A$50,MATCH(L22,'Excel Table'!$B$2:$B$50,0))

  8. #8
    Registered User
    Join Date
    12-05-2015
    Location
    Nashville, Tennessee
    MS-Off Ver
    MS Office 2010
    Posts
    4

    Re: VLOOKUPS, MID, AND FIND Together Returning Last Cell in Array

    Oh, thank god!!! You are truly a lifesaver!! I've spent about six hours researching online, and I even went to all of my professors, but I wasn't able to figure it out until now. Thank you.

  9. #9
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: VLOOKUPS, MID, AND FIND Together Returning Last Cell in Array

    Yeah, you just had your references backwards.

    INDEX(List where your desired values will come from,MATCH(The item you're looking for, List of items that corresponds with desired value,0))

+ 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] Find cell in 2nd array using row and column from the first array Excel 2010 VBA
    By crywolf in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2015, 02:12 PM
  2. [SOLVED] FIND Function; looking for an array of strings and returning found string value
    By loloduane in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-05-2014, 04:11 AM
  3. Creating Summary sheet - VLOOKUPS/INDEX Returning Multiple Values
    By kelsrae in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-04-2014, 05:09 PM
  4. [SOLVED] Returning cell value in an array - instead of loop reference
    By danmack in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 11:28 AM
  5. [SOLVED] Returning False with multiple Vlookups while completing formula in others
    By silvenmyst in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-27-2012, 10:18 AM
  6. Replies: 2
    Last Post: 10-12-2012, 11:38 PM
  7. Replies: 1
    Last Post: 02-18-2012, 01:32 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