+ Reply to Thread
Results 1 to 8 of 8

Tweaked Vlookup to ignore context?

  1. #1
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Tweaked Vlookup to ignore context?

    Hi

    I was wondering, is it possible to edit the vlookup formula so that it ignores context and only looks for certain predefined terms from a list. For example: Vlookup "silty clay" in a column where it says "slightly silty clay"?
    Or is there a search type function that would retun just specific text (predefined in a list) and ignore the rest of the context?

    Thanks

    Best regards,

    Marius

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Tweaked Vlookup to ignore context?

    Can you post a small sample of what you have and what you expect?

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    HTH
    Regards, Jeff

  3. #3
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Tweaked Vlookup to ignore context?

    There you go, hope that makes sense.

    Thanks for quick reply.
    Attached Files Attached Files

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Tweaked Vlookup to ignore context?

    If "gravelly silty clay" is found in the text to search, so is "silty clay" and "clay".
    Lookup functions such as VLOOKUP and INDEX MATCH return the first match.
    This means that whichever match is found first in column A will be the one to be returned.

    One way to try and combat this would be to sort column A in a way that has the most specific items up top then use a formula like this:

    C2 =INDEX(definedlist,MATCH(TRUE,ISNUMBER(SEARCH(definedlist,B2)),0)) Ctrl Shift Enter

  5. #5
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Tweaked Vlookup to ignore context?

    Did that work for you? I am just getting #N/A when trying it?

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Tweaked Vlookup to ignore context?

    Yes it did. Did you confirm the formula using Ctrl Shift Enter instead of just Enter?

    See attachment. I put an empty column in between your lookup column and the text to search for visual clarity.
    Attached Files Attached Files

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Tweaked Vlookup to ignore context?

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

  8. #8
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: Tweaked Vlookup to ignore context?

    Quote Originally Posted by 63falcondude View Post
    If "gravelly silty clay" is found in the text to search, so is "silty clay" and "clay".
    Lookup functions such as VLOOKUP and INDEX MATCH return the first match.
    This means that whichever match is found first in column A will be the one to be returned.

    One way to try and combat this would be to sort column A in a way that has the most specific items up top then use a formula like this:

    C2 =INDEX(definedlist,MATCH(TRUE,ISNUMBER(SEARCH(definedlist,B2)),0)) Ctrl Shift Enter
    Okay so I works now. I did sort the list with the more specific terms at the top like: silty gravelly clay, silty clay, clay...
    However, now is it searches for just clay it returns the first cell with clay in it, which in this case is silty sandy gravelly clay. How can I add on an exact match on it?

    Also I noticed when I search for slightly silty clay (it should ignore slightly) it returns silty sandy gravelly organic cobbles?

    Cheers

+ 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. Replies: 5
    Last Post: 03-28-2018, 12:20 PM
  2. Vlookup(ignore 0)
    By whatsmyname in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-14-2010, 12:21 AM
  3. IF AND statement-how this can be tweaked
    By Arod65 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-05-2007, 06:01 PM
  4. [SOLVED] vlookup, but ignore errors if #n/a
    By db in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 09:05 PM
  5. [SOLVED] vlookup, but ignore errors if #n/a
    By Jess in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  6. [SOLVED] vlookup, but ignore errors if #n/a
    By Jess in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. [SOLVED] vlookup, but ignore errors if #n/a
    By Jess in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM

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