+ Reply to Thread
Results 1 to 9 of 9

Formula / array to return multiple values

  1. #1
    Registered User
    Join Date
    01-03-2008
    Posts
    8

    Formula / array to return multiple values

    Hi all new to this so please excuse me if this has been covered already.
    Column A is a list a numerical codes and Column B is a list of names sadly codes aren't unique to the name. I have ran a pivot to get the codes simplified and now I want to match up the name(s) to the code. Vlookup will only return one value per code unless there is a clever way of expanding its parameters.

    Thanks in advance

    Paul

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Paul - see if the attachment helps.

    Is it just me or is this site incredibly slow atm?
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-03-2008
    Posts
    8
    impressive piece of code, am sure it will help once my eyes focus on it. not investigated yet but any chance I can change it to have names going across rather than down? Thanks again

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Yes, but perhaps you could a sample of how your desired output?

  5. #5
    Registered User
    Join Date
    01-03-2008
    Posts
    8
    pfa sample workbook of how I would like to display the info

    yes this is running v v slow
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Thanks, not just me then.

    Have a look at the attachment.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-03-2008
    Posts
    8
    I assume it is just because i'm a bit slow on this but I cant make your example work for me. Attached is another sample worksheet showing what I have to start with am what I am trying to do. Apoogies if I have wasted your time so far. Thanks again
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    I tried adding an attachment but the site appears to be having a bad day. Put this formula in E4 and drag down and across as far as necessary. It's an array formula so press Ctrl+Shift+Enter to insert.

    =IF(COUNTIF($A$4:$A$11,$D4)<COLUMNS($E4:E4),"",INDEX($B$4:$B$11,SMALL(IF($A$4:$A$11=$D4,ROW($A$4:$A$11)-ROW($A$4)+1),COLUMNS($E4:E4))))

    EDIT: somebody stoked the furnaces, see attachment also.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-03-2008
    Posts
    8
    brilliant thak you very much for your assistance

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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