+ Reply to Thread
Results 1 to 4 of 4

Vlookup: need to insert multiple non- numerical results in one cell

  1. #1
    Registered User
    Join Date
    11-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    72

    Vlookup: need to insert multiple non- numerical results in one cell

    I have a Companies worksheet and a Contacts worksheet. Within the contacts sheet, I have a column with companies and then contacts. There are multiple contacts at each company and thus, duplicate instances of each company in the companies column. I am attempting to insert the contacts at each company in one cell under the Companies worksheet.

    I originally got this to work by inserting a helper column under the contacts worksheet that inserted the company name plus the number of times it occurred previously in the list... =B4&COUNTIF($B$2:B4,B4) and then using =VLOOKUP(companyname&1,range:range,column,FALSE)&" / "&VLOOKUP(companyname&2,range:range,column,FALSE)etc... This currently works as long as I have the same amount of vlookups in my formula as there are companies available in the contact sheet, the issue is that it's not automated. In other words, if the company currently has 3 additional contacts and I add the vlookups together 3 times, it works, but once I add an additional contact, I have to update the formula to include another vlookup function. Alternatively, if I delete a contact, the formula then produces an error because the 3rd result no longer exists and thus, I have to edit my formula.

    IE:
    A / B / C
    Walmart1 / Walmart / Joe
    Target1 / Target / Sue
    Walmart2 / Walmart / Jack
    Walmart3 / Walmart / John

    Formula for single cell: =VLOOKUP(walmart&1,$A$1:$C$4,3,FALSE)&" / "&VLOOKUP(walmart&2,$A$1:$C$4,3,FALSE)&" / "&VLOOKUP(walmart&3,$A$1:$C$4,3,FALSE)
    Result for single cell: Joe / Jack / John

    Can anybody suggest a better method that prevents me from having to update my formula every time I update the contacts worksheet?

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Vlookup: need to insert multiple non- numerical results in one cell

    Do it like this:

    =IFERROR(VLOOKUP(walmart&1,$A$1:$C$4,3,FALSE),"")&IFERROR(" / "&VLOOKUP(walmart&2,$A$1:$C$4,3,FALSE),"")&IFERROR(" / "&VLOOKUP(walmart&3,$A$1:$C$4,3,FALSE),"")

    You can extend it by highlighting the red part in the Formula bar, then CTRL-C, then move the cursor to the end of the formula and CTRL-V as many times as you need - you will have to manually change the 3 (shown in blue) to 4, 5, 6 etc. If you had the company names in another cell (e.g. E2), then you could replace that in the formula with a reference to the cell, like E2&1 rather than walmart&1, to make it more general.

    Then copy the formula down.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    11-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Vlookup: need to insert multiple non- numerical results in one cell

    That did the trick. Thank you so much for your help. Much appreciated.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Vlookup: need to insert multiple non- numerical results in one cell

    You're welcome - glad to be of help.

    Pete

+ 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] IF calculation with multiple criteria with formula derived numerical and text results
    By Groovicles in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-29-2013, 06:19 PM
  2. Replies: 0
    Last Post: 06-26-2013, 08:46 PM
  3. [SOLVED] Multiple Vlookup results in one cell
    By ezrizer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2013, 08:37 PM
  4. Vlookup with multiple results comma seperated in cell
    By ledworld in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-18-2013, 03:53 PM
  5. [SOLVED] How can I insert numerical bullets in a cell ex: 1a) ?
    By Daisy in forum Excel General
    Replies: 3
    Last Post: 07-08-2005, 12:05 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