+ Reply to Thread
Results 1 to 14 of 14

VLOOKUP with multiple items in one cell?

  1. #1
    Registered User
    Join Date
    09-07-2018
    Location
    Massachusetts
    MS-Off Ver
    2016
    Posts
    11

    VLOOKUP with multiple items in one cell?

    Hello,

    I'm trying to look up a specific code within a list of many other codes. The problem is that many of the codes share a cell because they correspond to the same data I'm trying to move over.

    For example, I'm trying to look up the sic code '3271-0000' but the code exists in a cell that also contains 9 other 8 digit sic codes that all correspond to the same market. Is it possible to look up this specific code even though the code in the lookup table shares a cell with multiple other codes?

    Thanks!

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

    Re: VLOOKUP with multiple items in one cell?

    yes.

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

    2. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    3. Make sure that your desired solution is also shown (mock up the results manually).

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    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

  3. #3
    Registered User
    Join Date
    09-07-2018
    Location
    Massachusetts
    MS-Off Ver
    2016
    Posts
    11

    Re: VLOOKUP with multiple items in one cell?

    Quote Originally Posted by Glenn Kennedy View Post
    yes.

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

    2. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    3. Make sure that your desired solution is also shown (mock up the results manually).

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    I've attached a sample file. I'm trying to populate columns G and H on 'SALES RAW DATA' with data in columns K and L on 'NEW WITH MAP'
    Attached Files Attached Files

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

    Re: VLOOKUP with multiple items in one cell?

    In G2, copied across and down:

    =IFERROR(INDEX('NEW WITH MAP'!K$2:K$200,MATCH("*"&$C2&"*",'NEW WITH MAP'!$F$2:$F$200,0)),"")
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-07-2018
    Location
    Massachusetts
    MS-Off Ver
    2016
    Posts
    11

    Re: VLOOKUP with multiple items in one cell?

    Quote Originally Posted by Glenn Kennedy View Post
    In G2, copied across and down:

    =IFERROR(INDEX('NEW WITH MAP'!K$2:K$200,MATCH("*"&$C2&"*",'NEW WITH MAP'!$F$2:$F$200,0)),"")
    Thank you but G2 is where the titles are, not the first line of data so this doesn't make sense. Also there are many blanks in columns G and H when there shouldn't be any because all of the codes have matching corresponding codes in the look up table.

    Thank you for the attempt. This is clearly beyond my skill set.

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

    Re: VLOOKUP with multiple items in one cell?

    Add some expected results, calculated manually, and repost.

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

    Re: VLOOKUP with multiple items in one cell?

    I was pretty sure it was OK. I simply started one row up. G3 copied down.

    =IFERROR(INDEX('NEW WITH MAP'!K$2:K$200,MATCH("*"&$C3&"*",'NEW WITH MAP'!$F$2:$F$200,0)),"")
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-07-2018
    Location
    Massachusetts
    MS-Off Ver
    2016
    Posts
    11

    Re: VLOOKUP with multiple items in one cell?

    Quote Originally Posted by Glenn Kennedy View Post
    Add some expected results, calculated manually, and repost.
    I manually added expected results up to row 29. There shouldnt be any data in G2 or H2 because its pulling from a blank cell (C2)
    Attached Files Attached Files

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

    Re: VLOOKUP with multiple items in one cell?

    Grrr. It took me a while to find my mistake in this formula... it was taking forever to calculate...

    =IFERROR(INDEX('NEW WITH MAP'!K$2:K$200,SUMPRODUCT((ISNUMBER(SEARCH($C3,'NEW WITH MAP'!$F$2:$F$200)))*(ROW($F$2:$F$200)-ROW($F$2)+1))),"")
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    09-07-2018
    Location
    Massachusetts
    MS-Off Ver
    2016
    Posts
    11

    Re: VLOOKUP with multiple items in one cell?

    Quote Originally Posted by Glenn Kennedy View Post
    Grrr. It took me a while to find my mistake in this formula... it was taking forever to calculate...

    =IFERROR(INDEX('NEW WITH MAP'!K$2:K$200,SUMPRODUCT((ISNUMBER(SEARCH($C3,'NEW WITH MAP'!$F$2:$F$200)))*(ROW($F$2:$F$200)-ROW($F$2)+1))),"")
    I sincerely appreciate your effort on this but it still isn't correct. Based on the lookup table Cell G10 should be AEROSPACE not DEFENSE. I'm assuming there are other issues as well. I really appreciate your help but unfortunately I think I will have to resort to separating all of the codes into individual cells.

  11. #11
    Registered User
    Join Date
    09-07-2018
    Location
    Massachusetts
    MS-Off Ver
    2016
    Posts
    11

    Re: VLOOKUP with multiple items in one cell?

    Quote Originally Posted by Glenn Kennedy View Post
    Grrr. It took me a while to find my mistake in this formula... it was taking forever to calculate...

    =IFERROR(INDEX('NEW WITH MAP'!K$2:K$200,SUMPRODUCT((ISNUMBER(SEARCH($C3,'NEW WITH MAP'!$F$2:$F$200)))*(ROW($F$2:$F$200)-ROW($F$2)+1))),"")
    If you could somehow fix this it would be insanely appreciated. I am just not familiar with the functions you're using so if not I will have to just split them up.

    Regardless, +rep to you Glenn. A valiant effort as it stands. Thanks again.

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

    Re: VLOOKUP with multiple items in one cell?

    Back in an hour...

  13. #13
    Registered User
    Join Date
    09-07-2018
    Location
    Massachusetts
    MS-Off Ver
    2016
    Posts
    11

    Re: VLOOKUP with multiple items in one cell?

    Quote Originally Posted by Glenn Kennedy View Post
    Back in an hour...
    You're amazing sir. Another error I found was G30 and G31 should not be in the power generation segment. If the lookup table is column F on 'NEW WITH MAP' then G30 and G31 should be blank because the matching SIC codes are in cell G80 of 'NEW WITH MAP'

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

    Re: VLOOKUP with multiple items in one cell?

    Funny... twice in one day. I am having the same issue in another, similar, thread. Except that there there are 62,000 rows of dta...

    So. I have fixed G30/31. Silly me. I left a step out.

    G10 is wrong becasue there are DUPLICATE entries for it (3728-0203 occurs in F2 and in F3). This is not caused by me mucking around, as the duplicate also exists on your first sheet. Can you confirm thta duplicates can occur? If so, do you want the first of the duplicate values, or the last, as your result?
    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. [SOLVED] Vlookup that returns he average value for items with multiple values
    By AggieGradStudent in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-08-2017, 03:49 PM
  2. Using vlookup? to populate a listbox with multiple items.
    By msnyder1112 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-27-2016, 11:53 AM
  3. [SOLVED]How to VLookup multiple items when the source has multiple identical numbers
    By jackson_hollon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-17-2014, 12:56 AM
  4. [SOLVED] vlookup of two items to return a third vlookup value into a cell
    By PhoenixFaery in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2013, 07:33 PM
  5. Vlookup multiple items vba
    By foseco in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-21-2009, 11:29 AM
  6. Vlookup multiple items using two columns
    By av_ace11 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-14-2009, 07:11 AM
  7. Want Vlookup to list multiple items with the same key?
    By GarToms in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-10-2006, 06:21 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