+ Reply to Thread
Results 1 to 9 of 9

Index-Match + LEFT Function

Hybrid View

  1. #1
    Registered User
    Join Date
    06-09-2015
    Location
    Atlanta, Georgia
    MS-Off Ver
    MS Office 11 Mac
    Posts
    4

    Question Index-Match + LEFT Function

    Hello all,

    I am working on a spreadsheet with two different reports (on different sheets) from different sources. As such, I want to combine all of this data for these two sheets onto one sheet. The data is for products but on one sheet there are 5000 products and on another there are 8703. Thus, it wouldn't work to sort by alphabetical order.

    The formula I have been using that has worked for some of the cells is:

    Formula: copy to clipboard
    =INDEX(Sheet2!D:D,MATCH("*"&LEFT(A2,10)&"*", Sheet2!A:A, 0))


    On Sheet 1, I have "Product A" in cell A2 and what I essentially want it to do is to look through the A column of Sheet 2 to find "Product A" and it's corresponding "Number of Units Sold" value (Column D, Sheet 2).

    The issue with this formula is the "Number of Characters" value in the LEFT function. When I set it to 10, it pulls up many of the values and omits some (whose names are less than 10 characters).

    Is there something I can replace the 10 with that will just automatically select ALL characters? The reason I have to do this is that a lot of products don't exactly match in product name. For example, there could be a hyphen or a capitalization of a letter that would throw off the exact match function.

    If this is difficult to understand, please let me know. I really appreciate your help!

  2. #2
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Index-Match + LEFT Function

    You could try this. It would select all of the characters in A2 and find any matches in sheet2 that had any of those characters in them.
    =INDEX(Sheet2!D:D,MATCH("*"&A2&"*", Sheet2!A:A, 0))
    Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.

    <---Click * Add Reputation for all helpful comments. It's like giving a smile.
    Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.

  3. #3
    Registered User
    Join Date
    06-09-2015
    Location
    Atlanta, Georgia
    MS-Off Ver
    MS Office 11 Mac
    Posts
    4

    Re: Index-Match + LEFT Function

    Thanks for your reply nigelbloomy. I tried plugging it in but it only returns #N/A.

  4. #4
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Index-Match + LEFT Function

    Can you post a small sample of your worksheet with the problem you are having? You can remove any sensitive data.

  5. #5
    Registered User
    Join Date
    06-09-2015
    Location
    Atlanta, Georgia
    MS-Off Ver
    MS Office 11 Mac
    Posts
    4

    Re: Index-Match + LEFT Function

    I think I figured it out! I ended up using the VLOOKUP function

    Formula: copy to clipboard
    =VLOOKUP(A1,Sheet2!$A$2:$E$8702,4,TRUE)

  6. #6
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Index-Match + LEFT Function

    Are you sure that will work? The "TRUE" at the end will find the closest match, not the exact match.

  7. #7
    Registered User
    Join Date
    06-09-2015
    Location
    Atlanta, Georgia
    MS-Off Ver
    MS Office 11 Mac
    Posts
    4

    Re: Index-Match + LEFT Function

    I think the problem with putting FALSE is that a lot of my cells are formatted differently so it can't pull up the data. When I assign TRUE, it actually pulls up correct data for the lines I have seen so far. Do you know any other way to find an approximate match? Thanks!

  8. #8
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Index-Match + LEFT Function

    The wildcard characters should have worked as long as the values you are using are text. True in vlookup is one way to find an approximate match. You can also use 1 or -1 at the end of the match formula.

  9. #9
    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
    53,048

    Re: Index-Match + LEFT Function

    if you are using TRUE, vlookup expects a sorted list. It will then look down that list for what you want...if it cannot find an exact match, it will return the next lowest entry below where it *thinks* an exact match would have been. If your vlookup is giving you the answer you want, I suspect it is purely coincidental.

    upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    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

+ 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] INDEX/MATCH? - Return Value to left with IF function
    By macrav in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-02-2014, 04:05 PM
  2. [SOLVED] Index + Match to return result with Left function
    By Groovicles in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-21-2014, 02:35 PM
  3. [SOLVED] Left Function in Combination with IF, LOOKUP, MATCH, or INDEX?
    By superwhoever in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 10-29-2012, 01:31 AM
  4. using LEFT, MID, RIGHT with INDEX, MATCH?
    By tom_19 in forum Excel General
    Replies: 2
    Last Post: 09-26-2011, 09:16 PM
  5. use index, match and left in the same formula
    By jahardy in forum Excel General
    Replies: 4
    Last Post: 08-21-2009, 04:09 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