+ Reply to Thread
Results 1 to 10 of 10

Lookup to return multiple values horizontally

  1. #1
    Registered User
    Join Date
    01-06-2014
    Location
    Berkshire, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Lookup to return multiple values horizontally

    Hi,

    First time on the site today and found some very useful info.

    However, I'm unable to find a way to return multiple values horizontally from different sheets on the same workbook.
    I've seen various examples of this where the all the values are on the same worksheet, but have been unable to modify to fit my requirements.
    I'm basically trying to return multiple values (Locations) on a per value (Circuit) basis:

    I've attached a workbook (Book 1) which has the following:

    Sheet 1
    Shows Circuits (in some cases multiple instances) and their respective Locations

    Sheet 2
    Shows unique Circuit Reference values.

    I would like to return the associated Location Reference horizontally against each Circuit Reference on Sheet 2 (have shown the required end result on the workbook).

    Would appreciate any assistance here.

    Thanks in advance

    Rob
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Lookup to return multiple values horizontally

    =VLOOKUP(A2,Sheet2!$A$2:$F$11,2+COUNTIF(Sheet1!$A$1:A1,A2),FALSE)

    In B2 and copy down

  3. #3
    Registered User
    Join Date
    01-06-2014
    Location
    Berkshire, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Lookup to return multiple values horizontally

    Hi yudlugar,

    Thanks for the quick reply.
    Unfortunately, that seems to return a circular reference warning and then a value of '0' when applied.
    Are you able to update my spreadsheet with the formula you've suggested?

    Rob

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Lookup to return multiple values horizontally

    Afraid attachments aren't working for me (sometimes blocked on this connection) I just double checked it on the example you uploaded and it works fine though. Just to double check you are putting it in cell B2 or sheet1?

  5. #5
    Registered User
    Join Date
    01-06-2014
    Location
    Berkshire, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Lookup to return multiple values horizontally

    I'm putting the formula on Sheet 2 Cell B2
    So effectively overwriting the previous value that I had manually put there to show what results I was after.

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Lookup to return multiple values horizontally

    ah ok sorry - I thought you wanted to create the list in sheet1 from the values in sheet2, to go the other way:
    =IF(SMALL(IF(Sheet1!$A$2:$A$21=Sheet2!$A2,ROW(A$1:A$20),10000),COLUMN(A1))=10000,"",INDEX(Sheet1!$B$2:$B$21,SMALL(IF(Sheet1!$A$2:$A$21=Sheet2!$A2,ROW(A$1:A$20),10000),COLUMN(A1))))
    as an array formula (confirm with ctrl+shift+enter) in Sheet2!B2 and copy across/down.

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Lookup to return multiple values horizontally

    Please see attached file.
    Attached Files Attached Files
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  8. #8
    Registered User
    Join Date
    01-06-2014
    Location
    Berkshire, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Lookup to return multiple values horizontally

    That works, thanks yudlugar.
    Thanks also to AlKey for uploading the formula to the example sheet.
    One quick check whilst you're both around! the sheet I uploaded was test data cut down for the purpose of obtaining the correct formula.
    However, I've now transposed the correct data on there (much the same in terms of headers/values) but a lot more data, when I drag the formula down the page, it's only working up to Row 15, anything after that and it's not returning anything.
    Is there anything in the formula to limit this to just the data rows on the original Book 1 sheet or should I be able to drag the formula?
    Thanks again so far!

  9. #9
    Registered User
    Join Date
    01-06-2014
    Location
    Berkshire, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Lookup to return multiple values horizontally

    Attaching Book 2 sheet
    Attached Files Attached Files

  10. #10
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Lookup to return multiple values horizontally

    Here is the formula with adjusted ranges

    ***This is an array formula and must be confirmed with Ctrl+Shift and ENTER key combination.

    =LOOKUP("ZzzzzzTV",CHOOSE({1,2},"",INDEX(Sheet1!$B$2:$B$10000,SMALL(IF(Sheet1!$A$2:$A$10000=$A2,ROW(Sheet1!$A$2:$A$10000)-1,""),COLUMNS($A$1:A1)))))

+ 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] Return multiple values horizontally using vlookup
    By ThatGuyinBLue in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-03-2013, 05:02 AM
  2. [SOLVED] Is it possible to lookup multiple values and return multiple rows of results?
    By justin11 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-20-2013, 12:02 PM
  3. return multiple values horizontally while removing duplicates
    By kingi in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-24-2013, 03:55 PM
  4. lookup multiple values in multiple columns to return a result
    By AYAHOO123 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2013, 07:53 PM
  5. Lookup and return multiple Values
    By Neil in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 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