+ Reply to Thread
Results 1 to 7 of 7

VLOOKUP to return multiple results in one line

  1. #1
    Registered User
    Join Date
    05-03-2012
    Location
    Cape Towon
    MS-Off Ver
    Office 365
    Posts
    20

    VLOOKUP to return multiple results in one line

    Hi

    I need a VLOOKUP function that will compare e-mail addresses on sheet "main sheet", column A with E-mail addresses on sheet " Data sheet" column D and return the corresponding data "Data Sheet" column A on sheet "main sheet" column B.

    I used this formula on "main sheet", =VLOOKUP(A2;'Data Sheet'!$A:$E;2;TRUE) - see attached example

    but I need the result to have all possible results.

    Thus multiple results in one line. Meaning if it was critical for peter in row 1 and Medium in row 3, then both to show in "main sheet" column b

    Thanks for the assistance
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: VLOOKUP to return multiple results in one line

    Are you still using Excel 2007? If not, please update your forum profile. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    Re: VLOOKUP to return multiple results in one line

    Here's a way of doing it if you are using XL2007 (like me).

    Put this formula in E2 of the Data Sheet:

    =IF(D2="","-",D2&"_"&COUNTIF(D$2:D2,D2))

    Copy this down to the bottom of your data (or beyond, if you expect to add more in the future - the hyphens will show where the formula is active).

    Then you can use this formula in B2 of the Main sheet:

    =IFERROR(INDEX('Data Sheet'!$B:$B,MATCH($A2&"_1",'Data Sheet'!$E:$E,0))&" ","") & IFERROR(INDEX('Data Sheet'!$B:$B,MATCH($A2&"_2",'Data Sheet'!$E:$E,0))&" ","") & IFERROR(INDEX('Data Sheet'!$B:$B,MATCH($A2&"_3",'Data Sheet'!$E:$E,0))&" ","")

    this will give up to 3 multiple results per email, but it can be easily expanded for more, if required.

    Hope this helps.

    Pete

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: VLOOKUP to return multiple results in one line

    ARRAY formula in B2 then copied across.

    =IFERROR(INDEX('Data Sheet'!$B$2:$B$7,SMALL(IF('Data Sheet'!$D$2:$D$7=$A2,ROW('Data Sheet'!$D$2:$D$7),""),COLUMNS($B2:B2))-ROW($A$1)),"")

    To enter ARRAY formula
    Copy and paste the formula in cell
    Press F2
    Press Ctrl+Shift+Enter together
    Excel covers the formula with {}.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    05-03-2012
    Location
    Cape Towon
    MS-Off Ver
    Office 365
    Posts
    20

    Re: VLOOKUP to return multiple results in one line

    I use Office 365 will it be the same?

  6. #6
    Registered User
    Join Date
    05-03-2012
    Location
    Cape Towon
    MS-Off Ver
    Office 365
    Posts
    20

    Re: VLOOKUP to return multiple results in one line

    thanks for the help so far

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: VLOOKUP to return multiple results in one line

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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 a summary of multiple vlookup results
    By JohnElliott in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-18-2019, 09:55 AM
  2. Help using vlookup to return multiple results for one vlookup value
    By Akmon in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-27-2015, 06:00 AM
  3. How VLOOKUP can return multiple results
    By BOB202 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-07-2013, 03:50 PM
  4. Vlookup (or something!) to return multiple results?
    By Madraykin in forum Excel General
    Replies: 3
    Last Post: 04-24-2012, 11:30 AM
  5. Vlookup to return multiple results?
    By cdotyii in forum Excel General
    Replies: 8
    Last Post: 09-05-2011, 10:23 AM
  6. Replies: 3
    Last Post: 01-24-2007, 05:38 AM
  7. [SOLVED] how to return multiple results in vlookup?
    By Landa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-20-2006, 03: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