+ Reply to Thread
Results 1 to 7 of 7

Vlookup a value with multiple results

  1. #1
    Registered User
    Join Date
    08-05-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    7

    Vlookup a value with multiple results

    Hi All,

    I am struggling to find a formula for an excel exercise I have tried with Match and Index but not much of a luck ( maybe the formula was not set up properly).

    E.g.

    I have a list with name and seats , this list has multiple name against same seat. as per below:

    Seat Name
    1 A
    2 B
    3 C
    4 D
    5 E
    6 F
    1 G
    3 H

    I would like to allocate the giving seat against the right name as per below :


    Seat Name Should be
    1 ? A
    2 ? B
    3 ? C
    1 ? G
    4 ? D
    3 ? H
    5 ? E
    6 ? F

    Can you please help me?

    Thanks

    Carmine
    Last edited by CGV; 03-15-2016 at 03:22 AM.

  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,864

    Re: Vlookup a value with multiple results

    I'd follow human way to find it. assuming your original data is in A2:B9 (plus headers in A1:B1) and list of seats to be reassigned starts in D2, in E2 array formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and copy down
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    08-05-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Vlookup a value with multiple results

    Hi Kaper,

    Thank you so much about this, seems that it is what I need, but when I extent the range to the entire column the formula comes with N/A even with the CTRL+SHIFT+ENTER , can you please extend the the entire column?
    Thanks

    Carmine

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

    Re: Vlookup a value with multiple results

    You should avoid using entire columns as range references in certain functions. IF being one of them.

    Assume your table is the range D1:E8.

    Data Range
    A
    B
    C
    D
    E
    1
    1
    A
    1
    A
    2
    2
    B
    2
    B
    3
    3
    C
    3
    C
    4
    1
    G
    4
    D
    5
    4
    D
    5
    E
    6
    3
    H
    6
    F
    7
    5
    E
    1
    G
    8
    6
    F
    3
    H
    9
    ------
    ------
    ------
    ------
    ------


    This array formula** entered in B1 and copied down:

    =IFERROR(INDEX(E:E,SMALL(IF(D$1:D$8=A1,ROW(D$1:D$8)),COUNTIF(A$1:A1,A1))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    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,864

    Re: Vlookup a value with multiple results

    The formula shall work well if properly extended (input range is used 3 times). For instance:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Vlookup a value with multiple results

    If you put your data in an Excel table, then you should not have to worry about extending the formula or referencing extra rows. An Excel table knows how big it is and uses column header names instead of cell references so formulas are a lot easier to read.

    This article should get you started with Excel Tables: http://www.utteraccess.com/wiki/inde...ables_in_Excel
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

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

    Re: Vlookup a value with multiple results

    Quote Originally Posted by dflak View Post
    uses column header names instead of cell references so formulas are a lot easier to read.
    I guess that's a personal preference.

    Personally, I prefer cell/range addresses.

    So, you send me a file and I want to review the values used in this formula:

    =SUM(Groups)

    If it was written as:

    =SUM(Sheet2!A1:A10)

    I would instantly know where to look.

    But no, I first have to find out where "Groups" is located!

+ 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. 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
  2. [SOLVED] using Vlookup with multiple results and averaging the results.
    By xatomicx in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2015, 10:19 AM
  3. Want multiple results from Vlookup
    By Gallinski in forum Excel General
    Replies: 4
    Last Post: 02-09-2012, 08:18 PM
  4. Vlookup, multiple row results
    By darvistor in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-01-2011, 06:30 PM
  5. Vlookup with multiple results
    By spanna16 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-24-2009, 11:43 PM
  6. Multiple Results for VLookUp
    By sighlent1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-12-2009, 01:09 PM
  7. VLOOKUP for multiple results
    By Steamboat in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-29-2005, 10:27 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