+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP a full text in a partial data field

  1. #1
    Registered User
    Join Date
    03-28-2014
    Location
    London, England
    MS-Off Ver
    Excel 2011
    Posts
    3

    VLOOKUP a full text in a partial data field

    Hi,

    I am trying to look up a whole value in a partial data field, pulling through the partial data. For example cell A1 includes product description followed by location, I am trying to pull through just the location into B1 using the data from sheet 2.

    Eg. Sheet 1 Sheet 2
    Column A Column B Data
    Stapler, UK UK UK
    Pencil, UK UK Germany
    Stapler, Germany Germany etc...
    Pencil, Germany Germany


    I have tried using wildcards e.g. =VLOOKUP("*"&A1&"*",Sheet2!A:A,1,0) but have had no joy.

    Any advice would be great.

    Many Thanks,
    Luke

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,937

    Re: VLOOKUP a full text in a partial data field

    You need to post what you have on Sheet 1 and what you have on Sheet 2 in separate tables. Show what you have, and then also show what you want in a third table.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    03-28-2014
    Location
    London, England
    MS-Off Ver
    Excel 2011
    Posts
    3

    Re: VLOOKUP a full text in a partial data field

    Sorry I didn't realise how messed up the formatting gets.

    Screen Shot 2014-03-28 at 14.28.09.png

    Not sure if that has uploaded correctly, but basically in column 1 it will have the product description e.g. "Stapler, London, UK". In the next column I want to extract only the Country, which will vary, (in this case UK).

    In a separate sheet I will have a table with all the possible Countries, so I was wondering whether there is a way to look up the product description form column 1 and find a partial match in the table of countries, and if so pull through that country into column 2?

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,937

    Re: VLOOKUP a full text in a partial data field

    In Cell B2, array enter (enter using Ctrl-Shift-Enter instead of just Enter) this formula

    =MID(A2,MAX(IF(ISERROR(SEARCH(",",A2,ROW(INDIRECT("A1:A"&LEN(A2))))),0,SEARCH(",",A2,ROW(INDIRECT("A1:A"&LEN(A2))))))+2,LEN(A2))

    It will return whatever is after the last , in the cell, just in case you actually have

    Stapler, London, UK

    instead of just

    Stapler, UK

+ 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] Add Data for Full and Partial week
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2013, 04:20 PM
  2. Vlookup Partial Text String
    By dreicer_Jarr in forum Excel General
    Replies: 7
    Last Post: 05-26-2011, 09:23 PM
  3. Partial text vlookup
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2011, 05:35 AM
  4. conditional format based on sum of value assigned to partial text field
    By rshiley in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-19-2010, 06:44 PM
  5. vlookup not returning full field value (text)
    By JohnC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-27-2006, 07:10 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