+ Reply to Thread
Results 1 to 12 of 12

Return muliple values using Vlookup

  1. #1
    Registered User
    Join Date
    08-08-2012
    Location
    San Diego
    MS-Off Ver
    Excel 2010
    Posts
    11

    Return muliple values using Vlookup

    Hello,
    I know there have been posts to use Index function to search for a particular number or text in a database and return their respective row elements, but i was unabale to execute it.
    So here s the problem:
    In the excel WORKBOOK named 'UnitsperHr Database'. I have 5 columns namely CC,Job No., description, Budget.
    In my other excel WORKBOOK named 'Labor Productivities-COST CODE WISE-MK', I want to return all possible CC with their respective row elements.
    So say CC -730 in the first sheet, i want to return all possible 730's from workbook1 to workbook2 in the WORKSHEET named 730. Then there will be different Sheets for diffirent CC.
    PS 'CC' Means Cost code. I want different sheets for different cost codes based on the data that i will dump in workbook1
    Thanks for the help!!!

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Return muliple values using Vlookup

    Well, to address your very first sentence, you use MATCH to deliver the place number of the "particular number of text", and then INDEX uses that place number to get the same place number in the same, or adjacent, arrays.

    INDEX, and also VLOOKUP, are designed to deliver the first value they come across that meets the criteria. So, they're essentially unsuited to deliver all the matches. I'm not saying it's impossible to do; but, you have to do some major workarounds, and it's probably not the best way.

    Looking at just what you've got, I don't think you need to create another spreadsheet, just Filter the table you've already got.
    Last edited by ben_hensel; 08-09-2012 at 09:42 AM.

  3. #3
    Registered User
    Join Date
    08-08-2012
    Location
    San Diego
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Return muliple values using Vlookup

    Thank you ben, Thats what i am currently doing. But i want diferent cost codes in different worksheets so that my boss can analyze each cost code. What is the best way to do that?

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Return muliple values using Vlookup


  5. #5
    Registered User
    Join Date
    08-08-2012
    Location
    San Diego
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Return muliple values using Vlookup

    Jason, thats exactly what i wanted except that, whenever i add more data to my first excel workbook, i want this workbook to update as well. I dont even mind having one work book, like the one above in this post, such that whenever i add data to my master worksheet, all other cost codes worksheet update itself.
    Can it be done?
    Thanks a ton!!!

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Return muliple values using Vlookup

    That was just a quick test to see if it was suitable, the code was some that I use in one of my own workbooks with a few minor tweaks to match your data.

    As you're happy with that I'll make the other changes that it needs then post a revised version once I've got it right, that might not be until morning though, it's getting late this side of the atlantic lol.

  7. #7
    Registered User
    Join Date
    08-08-2012
    Location
    San Diego
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Return muliple values using Vlookup

    That's alright. Also will there be a way by which all the columns will be tabled or will i have to do it manually? Also I want to add a scatter chart for each. Can i do it for one sheet and copy on the others or will i have to do it for all the other sheets.
    But thank you so much. I know it is late back there.

  8. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Return muliple values using Vlookup

    Not tried doing this with tables or charts so that will be something new to have a go at.

    Do you update your master sheet slowhand (typing in 1 cell at a time), or copy and paste several rows from another source?

    Just having a few quick thoughts on how to make it work, would there be any problem with the code adding an extra column to the master sheet to keep track of the records?

  9. #9
    Registered User
    Join Date
    08-08-2012
    Location
    San Diego
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Return muliple values using Vlookup

    Well, it depends.. I do both. No there would be no problem adding an extra column to Keep track of changes. Also how can i use the code to create more excel workbooks such as this one so because i realise i can do away with a lot of data reentering/sorting with this kind ofcode.for eg; i get frieght calls for different constructionsites, and i want to enter all the calls in one master sheet and the correponding data such as date, qnty, remarks can automatically get parked in the respective excel worksheet categorized by construction site.

    Thank you so much.,

  10. #10
    Registered User
    Join Date
    08-08-2012
    Location
    San Diego
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Return muliple values using Vlookup

    Hey Jason,
    Have a look at the tab'730' which has a graph, the cells are tabled and there is avg of the data. Thats the idea to do for every cost code. Shortcuts appreciated.

    Thanks
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Return muliple values using Vlookup

    See what you think of this.

    You will need to click the button once to process the data that is already on the sheet, after that it will be processed automatically as you enter it.

    Copy of UnitsperHr Database.xlsm

    I've added something else that I use when I have a workbook with a lot of sheets, try double clicking, any cell, any sheet

  12. #12
    Registered User
    Join Date
    08-08-2012
    Location
    San Diego
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Return muliple values using Vlookup

    Jason,
    Perfect, thank you so much. I know whom to contact for all my excel doubts and adventures.

+ 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