+ Reply to Thread
Results 1 to 15 of 15

Potential combination of LookUp and DeDupe to create multiple values in a single cell

  1. #1
    Registered User
    Join Date
    03-01-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003
    Posts
    8

    Potential combination of LookUp and DeDupe to create multiple values in a single cell

    Is it possible to look up a cell in one tab against another, find multiple instances of the number, then using a different column pick out unique value and combine the unique values into a cell on the original tab?

    Hopefully the below helps clarify.

    Table 1 contains the reference number i want to look up:

    Reference Value
    1
    2
    3
    4

    Table 2 contains the values i need for my final table against the reference number i am looking up. A reference can have multiple values

    Reference Value
    1 Car
    2 Car
    3 Car
    4 Car
    1 Car
    1 Bus
    1 Train
    4 Bus

    Table 3 shows the end result. For each reference number the values are merged into one cell allowing one line for each reference.

    Reference Result
    1 Car;Bus; Train
    2 Car
    3 Car
    4 Car;Bus

    Hopefully someone has done something similar to this before. If i need to provide any further clarity, please let me know.

    Kris
    Attached Files Attached Files
    Last edited by Bwambale; 02-15-2016 at 06:11 AM.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    Maybe :

    Please Login or Register  to view this content.

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  4. #4
    Registered User
    Join Date
    03-01-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    Mick, that is exactly what I am looking for. Works a treat. Thank you!

  5. #5
    Registered User
    Join Date
    03-01-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    Karedog, thanks very much for coming back to me. I appreciate it. I couldn't quite get your code to work...i had an issue with the "arr" line. Mick's code seems to have done the trick so i think i can leave it here. Thanks again for the help folks!

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    You are welcome.
    But it run well on my file, could you test it ? Check the attachment.
    Attached Files Attached Files

  7. #7
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    You're welcome

  8. #8
    Registered User
    Join Date
    03-01-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    Hey Karedog, just tested this now and yeah, that works exactly like it should. Thanks!!

  9. #9
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    You are welcome, thanks for the feedback.


    Regards

  10. #10
    Registered User
    Join Date
    03-01-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    Hey Mick,

    Could you help with one more thing. Which part of the code would I need to alter to have the results displayed in column C instead of B? I am asking because I want to do something similar but collate info from a different field and list it in column C next to the data you helped with originally. Does that make sense?

  11. #11
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    My previous code shows the results in columns "A & B"
    Change as below for various options:-
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    03-01-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    Thanks Mick. I am not sure I explained just right what I am looking for. I have pasted your original code into my macro and my table now looks like:

    Sheet 1 in example.

    So now I want to look up column A as I did previously, but instead of taking the offset of 1 on "Sheet2" I want to take offset 6 say, and insert the list in a new column C. As per below:

    Sheet 2 in attached example

    Does that make sense or should we start again?

    Thanks in advance for all your help!
    Attached Files Attached Files
    Last edited by Bwambale; 02-24-2016 at 10:03 AM.

  13. #13
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    Try this :-
    NB:- See code comments for "Lookup column" and "Results column"
    Please Login or Register  to view this content.
    Regards Mick

  14. #14
    Registered User
    Join Date
    03-01-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003
    Posts
    8
    Perfect!! Thank you Mick!

  15. #15
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Potential combination of LookUp and DeDupe to create multiple values in a single cell

    You're welcome

+ 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. Multiple vlookup "lookup values" in a single cell?
    By catccc in forum Excel General
    Replies: 8
    Last Post: 10-19-2015, 05:10 PM
  2. Replies: 0
    Last Post: 06-24-2014, 05:51 PM
  3. Replies: 3
    Last Post: 04-08-2014, 03:11 AM
  4. Replies: 5
    Last Post: 07-07-2013, 03:39 PM
  5. Replies: 2
    Last Post: 03-22-2013, 07:42 AM
  6. Sum values from multiple cells - multiple lookup values in single cell
    By taxdept in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2012, 04:12 PM
  7. [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

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