+ Reply to Thread
Results 1 to 8 of 8

Multiple matches using Index Match - Prompt user to select which match to use as input

  1. #1
    Registered User
    Join Date
    02-24-2021
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    7

    Multiple matches using Index Match - Prompt user to select which match to use as input

    In a client workbook I am categorizing the client's suppliers based on previously collected information.

    Basically, I will receive a set of supplier names together with total annual expenditure.

    This information goes into on sheet with three columns: (1) Supplier name, (2) total annual expenditure and (3) Purchasing category.
    In column 3 I am using a standard Index Match formula to look up the category for each individual supplier. This information is listed in another sheet functioning as a register/database with information collected over several years from different clients.

    The formula is working fine. My issue is that there are instances where a supplier is listed 2 or 3 times in the register with different categories wich then results in the formula getting multiple matches and using the first match.
    An example would be a supplier that sells both software and hardware.

    What I would like to have happen is that the user in one way or the other would be prompted to select which match to use.
    Ideally the user would be presented with a drop down list in the target cell to choose category from. However, if that's not possible, the cell being highlighted would suffice.

    I have attached an example file in which Supplier B is listed both as a provider of Computer hardware and Computer software.
    I am using office 365 in Swedish. I don't know if formulas are translated automatically based on language settings used by the user, if not, I want to clarify that for the Index match formula the Swedish version replaces 'MATCH' with 'PASSA'.

    Grateful for any help I can get!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,625

    Re: Multiple matches using Index Match - Prompt user to select which match to use as input

    Work sheet event is used. Drop down is provided in column C of Supplier data sheet. Helper column AB is used.
    Code

    Please Login or Register  to view this content.

    To paste the code
    Right click on Sheet tab --> view code
    VB window opens.
    Paste the code
    Close the window.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,146

    Re: Multiple matches using Index Match - Prompt user to select which match to use as input

    In the register, in your sample, the data was sorted by supplier (the sole duplicate... supplier B 's entries were in adjacent rows). Is that ALWAYS the case?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Registered User
    Join Date
    02-24-2021
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Multiple matches using Index Match - Prompt user to select which match to use as input

    Thank you, this works brilliantly! However, do you know if it's possible to have the script combine your function with highlighting cells with multiple matches?
    The actual workbooks I am working with sometimes include thousands of suppliers. Checking each cell to see if there are multiple matches would therefore make it very time consuming.
    If the cells are highlighted, for instance by changing fill color, it would make my life a lot easier

  5. #5
    Registered User
    Join Date
    02-24-2021
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Multiple matches using Index Match - Prompt user to select which match to use as input

    Quote Originally Posted by Glenn Kennedy View Post
    In the register, in your sample, the data was sorted by supplier (the sole duplicate... supplier B 's entries were in adjacent rows). Is that ALWAYS the case?
    No this is not always the case, I just threw together the example file quickly before posting. The data is almost always sorted by expenditure.

  6. #6
    Registered User
    Join Date
    02-24-2021
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Multiple matches using Index Match - Prompt user to select which match to use as input

    Quote Originally Posted by kvsrinivasamurthy View Post
    Work sheet event is used. Drop down is provided in column C of Supplier data sheet. Helper column AB is used.
    Code

    To paste the code
    Right click on Sheet tab --> view code
    VB window opens.
    Paste the code
    Close the window.
    Thank you, this works brilliantly! However, do you know if it's possible to have the script combine your function with highlighting cells with multiple matches?
    The actual workbooks I am working with sometimes include thousands of suppliers. Checking each cell to see if there are multiple matches would therefore make it very time consuming.
    If the cells are highlighted, for instance by changing fill color, it would make my life a lot easier

  7. #7
    Registered User
    Join Date
    02-24-2021
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Multiple matches using Index Match - Prompt user to select which match to use as input

    Fixed the issue with providing an indication to the user for cells with 2 or more mathces using COUNTIF and IF formulas. Thanks for your help!

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,625

    Re: Multiple matches using Index Match - Prompt user to select which match to use as input

    In Sheet Register columns E to M I have given Formulas. Column E gives Names in alphabetical order. Columns F to M gives the category names for that Supplier. 1600 rows are covered. As you add names in column A automatically it up dates In E to M columns.
    code changed for worksheet event. This works very fast irrespective of number rows (even in thousands).
    Please Login or Register  to view this content.
    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. INDEX MATCH MATCH and return MAX value of multiple matches
    By njm0059 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-24-2018, 05:29 PM
  2. Index-Match with multiple matches?
    By mdbelles in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-08-2016, 04:21 PM
  3. User form with Index Match for 2 input boxes
    By Quasis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-22-2015, 05:32 PM
  4. Need VBA for INDEX MATCH where user selects all variables from Input Box
    By rrcrbnsn07 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2013, 02:43 PM
  5. [SOLVED] INDEX MATCH array formula that matches substring n gives multiple matches
    By bkwins in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-12-2013, 04:57 AM
  6. Replies: 4
    Last Post: 07-18-2012, 02:34 PM
  7. Multiple Matches - Index/Match
    By brdwlsh in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-26-2007, 12:00 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