+ Reply to Thread
Results 1 to 7 of 7

return multiple values for one lookup value in the same cell

  1. #1
    Registered User
    Join Date
    04-12-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    13

    return multiple values for one lookup value in the same cell

    Good morning,
    I am trying to match account numbers from sub account lists to a main account. If I use vlook up to finde the main account then vlook up can only return the first match. I am looking for a solution where I can search for the main account and return all the sub accounts, best in one cell.

    Any thoughts appreciated!

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,618

    Re: return multiple values for one lookup value in the same cell

    Basically it is not that easy task with built in excel functions. How about user defined function (workbook has to be macro enabled - for instance xlsm format.
    And additional question - how many main accounts and how many subaccounts you need to treat this way, and ... how many subaccounts per main account you expect (max)
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    04-12-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    13

    Re: return multiple values for one lookup value in the same cell

    I had a feeling. Its about 100 accounts, with up to 30 subaccounts

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,618

    Re: return multiple values for one lookup value in the same cell

    See if such function would do:
    Please Login or Register  to view this content.
    usage in a workshhet as a regular function - see cell B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    copy it down
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-12-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    13

    Re: return multiple values for one lookup value in the same cell

    Thank you for trying to help. I applied the formular to my work sheet and get a "#NAME" error...

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: return multiple values for one lookup value in the same cell

    You have to copy the VBA code and paste it into a general module before you can use it as a cell formula.

    Then you have to save the file as macro enabled file in the *.xlsm file format.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,618

    Re: return multiple values for one lookup value in the same cell

    Or other way round - copy your data into my file.

    Of course, usually the better way is to copy the code into your file.
    So open your file
    press Alt+F11
    in window with VBE press Alt+I
    then M
    module1 window shall appear - paste there the function code
    press Alt+F11
    save the file as macro-enabled
    close and open again allowing macro execution.
    Now you can use this function in your file

+ 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. Lookup and return multiple values concatenated into one cell
    By funinsum in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-09-2015, 06:26 PM
  2. [SOLVED] Return Multiple Lookup Values to One Cell
    By excelnoob927 in forum Excel General
    Replies: 3
    Last Post: 12-23-2014, 03:38 PM
  3. Lookup to return multiple cell values
    By gee83 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-11-2014, 09:20 AM
  4. [SOLVED] lookup multiple values of a single cell and return sum of results
    By Zeppelin17 in forum Excel General
    Replies: 7
    Last Post: 08-10-2011, 07:09 PM
  5. Replies: 4
    Last Post: 07-07-2006, 08:55 AM
  6. Using a lookup to return multiple values in one cell??
    By zim_zimmer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-07-2006, 08:10 AM
  7. [SOLVED] Using a lookup to return multiple values in one cell??
    By zim_zimmer in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-07-2006, 05:35 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