+ Reply to Thread
Results 1 to 5 of 5

Need a Vlookup formula to search based on part of a cell

  1. #1
    Registered User
    Join Date
    11-16-2017
    Location
    knoxville tn
    MS-Off Ver
    2016
    Posts
    13

    Need a Vlookup formula to search based on part of a cell

    Hey all, so I am trying to write a VLOOKUP (or anything that will get me where I need to be) and I cannot find what I need to make it work. Basically I have 2 lists on 2 different sheets. On Sheet 1 I have a list that in column A contains cells with multiple bits of information (D1.DC - David Ensor) and the only part that I actually care about is the name (David Ensor). On Sheet 2 I have a list of names in column A showing only the name (David Ensor) and column B has numbers in it associated with that person. What I need is a formula that will look at D1.DC - David Ensor and find David Ensor in Sheet2 and give me the number beside it. I can make it work if I do the lookup on just the name and it will find his name at the end of the string, but I really need it to go the other way. Unfortunately the list of people that I get sent (list from Sheet1) is not laid out the same other than the fact that the person's name is always there at the end, sometimes there are no spaces and sometimes there are no hyphens. I am trying to make my report so that i can just dump the list of names they send me each week into the sheet and pull the data from my master list (Sheet2 info). I hope this makes sense and someone can help me. It seems to me like this should be simple but I just cannot seem to get it figured out. Thanks so much for taking the time to read this. Basically what I need is below and I have attached a sample of what I am looking at.

    Sheet1, Cell A1 = D1.DC - David Ensor
    Sheet2, somewhere in the Column A list (A71) = David Ensor
    Sheet2, Column D next to David Ensor (D71) = 5
    Sheet1, Cell C1 needs to = 5 (Sheet2 Cell D71)
    Attached Files Attached Files
    Last edited by JesterGrafix; 09-01-2018 at 02:20 PM.

  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,830

    Re: VLOOKUP Help needed

    Please take a moment to re-read forum rule #1 and then amend your thread title to something that better explains your problem. Changing your thread title is not optional, which means you must change it. Thanks!

    • Use concise, accurate thread titles.
    • Your post title should describe your problem, not your anticipated solution.
    • Use terms appropriate to a Google search - poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice tell us nothing.
    • Responding to a request to change your thread title by doing so is mandatory.

    To change a title go to your first post, click EDIT then Go Advanced and change your title.

    No help to be offered, please, until the OP complies with this request.
    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 Contributor
    Join Date
    04-19-2015
    Location
    pakistan
    MS-Off Ver
    2013
    Posts
    335

    Re: VLOOKUP Help needed

    Hi

    please review sheet this is what you want,

    formula in D2 =VLOOKUP(TRIM(MID(A2,8,50)),Sheet2!A:D,4,0)
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-16-2017
    Location
    knoxville tn
    MS-Off Ver
    2016
    Posts
    13

    Re: VLOOKUP Help needed

    Quote Originally Posted by gondal View Post
    Hi

    please review sheet this is what you want,

    formula in D2 =VLOOKUP(TRIM(MID(A2,8,50)),Sheet2!A:D,4,0)
    This worked perfectly!!! Thanks so much for the help.

  5. #5
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Need a Vlookup formula to search based on part of a cell

    Hi,

    I'd like to point out that we can't reliably use 8 as the "start number" for the MID function as offered above.
    If you check Sheet1, A58 and A59, those will Error out even if there's an actual Match in Sheet2.

    This is probably a more reliable solution, I limited the range to 1000 rows, increase it if you like:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached, C2 formula as shown above, D2 formula to not show errors (change "No Match" to "" or whatever you want)
    Attached Files Attached Files

+ 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] Vlookup help needed
    By RodneyB in forum Excel General
    Replies: 6
    Last Post: 11-05-2017, 06:42 AM
  2. Vlookup help needed
    By AbuReemAT in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-08-2013, 04:32 PM
  3. Urgent help needed: Vlookup within a Vlookup
    By jozz90 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-15-2013, 07:57 AM
  4. Complex Vlookup/ VBA function or Macro Needed For "if contains text then vlookup"
    By alfykunable in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-09-2012, 03:48 AM
  5. Excel 2007 : vlookup help needed
    By baffled1 in forum Excel General
    Replies: 4
    Last Post: 05-11-2011, 06:47 PM
  6. VLOOKUP or IF( needed?
    By Johnnie in forum Excel General
    Replies: 2
    Last Post: 10-10-2009, 09:32 AM
  7. Replies: 5
    Last Post: 07-29-2009, 07:53 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