+ Reply to Thread
Results 1 to 7 of 7

Find item(s) in a cell and match to item(s) in a list

  1. #1
    Registered User
    Join Date
    10-19-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    16

    Find item(s) in a cell and match to item(s) in a list

    Hello,
    I am working on a decision-making tool which will help doctors choose an appropriate drug given a patient’s symptoms and the medications he is currently taking. Cell E9 (labeled “FirstChoice”) will give the doctor treatment instructions which includes a drug category (or categories) from which to choose a drug. Cell F9 (labeled “ProductsFirst”) then will look for the drug category (or categories) in E9 and output the corresponding brand name drug product(s).

    Cell E10 (“Alternative”) will give an optional drug category choice and also pull the brand name into F10 (the same concept as “FirstChoice”).

    The drug categories and products are:
    Category Product
    SAMA Atrovent
    LAMA Spiriva
    SABA Proair
    LABA Serevent
    ICS Aerobid
    SAMA+SABA Combivent
    LAMA+LABA Anoro
    ICS+LABA Advair

    I started thinking that I could do this within Excel using text functions (e.g., FIND, SEARCH, MID, LEN, etc.) and a VLOOKUP array, or INDEX-MATCH but quickly realized that that was becoming overwhelming and cumbersome and that VBA would be more efficient. I now think I need to use VBA functions such as FOR EACH, LOOP, FIND NEXT, etc. but having never written such a complicated loop, find myself at a loss as to where to even start.

    I’ve attached a partial copy of the workbook. I deleted non-relevant worksheets so some macros will not work. The sheet of interest is “Recommendation.” I manually entered outputs into cells E9, F9, E10, and F10 as examples.

    Many thanks in advance for your expertise. You all are the best!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-17-2017
    Location
    Hell
    MS-Off Ver
    2010
    Posts
    172

    Re: Find item(s) in a cell and match to item(s) in a list

    Some sheets are missing. In order for the macros to work all the sheets need to be in the workbook.

  3. #3
    Registered User
    Join Date
    10-19-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Find item(s) in a cell and match to item(s) in a list

    Thanks for your reply, Lewis. I intentionally deleted non-relevant sheets for proprietary reasons. I don't think they are critical to my request but if you believe otherwise, I will re-post the workbook with the sheets but with deleted content on those sheets or else I'll re-post an example workbook without those macros. Thank you for your willingness to help.

    Seleseped

  4. #4
    Registered User
    Join Date
    03-17-2017
    Location
    Hell
    MS-Off Ver
    2010
    Posts
    172

    Re: Find item(s) in a cell and match to item(s) in a list

    It would be best with some sample data and all worksheets and macros that you need in place. This way someone could help you specifically instead of unknowns.

  5. #5
    Registered User
    Join Date
    10-19-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Find item(s) in a cell and match to item(s) in a list

    I'll do that but won't be able to do so until Monday when I'm back at work.

  6. #6
    Registered User
    Join Date
    10-19-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Find item(s) in a cell and match to item(s) in a list

    I’ve attached the abbreviated workbook with only pertinent sheets included. I hope this will be enough to allow you to help me. Your time and assistance are MUCH appreciated.
    (If anybody is looking at the tool for clinical content, the output is TOTALLY bogus and not to be used in any situation.)
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-19-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Find item(s) in a cell and match to item(s) in a list

    Not getting any solutions offered from this help forum, I posted the question on another. The solution may be found at https://www.mrexcel.com/forum/excel-...ched-item.html. Thanks to all of you who took the time to consider my question on this forum.

+ 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. Return search item/s from array or list in a cell (exact match)
    By adm.patrikbpl in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-16-2017, 09:22 AM
  2. Replies: 5
    Last Post: 03-01-2017, 05:41 PM
  3. [SOLVED] Vba to match item description and copy/paste item code to other sheet
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2017, 11:29 AM
  4. Replies: 1
    Last Post: 08-22-2014, 12:27 AM
  5. UserForm: Search Item in List > Call Table associated with Item > Execute Command
    By TexasAggie12 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-25-2014, 12:58 PM
  6. Help with VBA, find Item from list then sum totals of each item by type
    By HR_GUY in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2013, 01:30 PM
  7. linking a list item or text item in a user form to a worksheet
    By ravergirl7216 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-03-2010, 03:43 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