+ Reply to Thread
Results 1 to 9 of 9

how to import multiple values w/ a vlookup into a single cell

Hybrid View

zazzz how to import multiple values... 11-01-2010, 12:54 AM
teylyn Re: how to import multiple... 11-01-2010, 03:39 AM
zazzz Re: how to import multiple... 11-01-2010, 11:36 PM
zazzz Re: how to import multiple... 11-06-2010, 01:36 AM
JBeaucaire Re: how to import multiple... 11-06-2010, 03:14 AM
zazzz Re: how to import multiple... 11-07-2010, 12:17 PM
JBeaucaire Re: how to import multiple... 11-07-2010, 04:38 PM
martindwilson Re: how to import multiple... 11-07-2010, 04:38 PM
zazzz Re: how to import multiple... 11-08-2010, 10:14 AM
  1. #1
    Forum Contributor
    Join Date
    06-21-2009
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    200

    how to import multiple values w/ a vlookup into a single cell

    ive posted this question on another forum as well but im not really getting a very informative answer there so wanted to ask it here. hope i can get some help... need this for a job interview
    previous post


    in my data worksheet there was Labour Expense 1 and Labour Expense 2.
    in the main sheet I was dealing with I just had Labour Expense. how would i get the sum of both LE1 and LE2 in there? now of course if i did it one by one this would be no problem but we want this to be in a way that can be duplicated easily, so by using vlookups or sumif statements. b/c in the data sheet there was also raw material expense 1 and RM expense 2, then rent 1 and rent 2, etc. now in this case there was only 1 and 2, but what if there had been a third, is there any simple way of dealing w/ that as well? i guess the simple way of doing this was to say - if in this range (ie column A) there's a value which starts off with "Labour" I want the corresponding figure (in column B) to be added.

    also in the data tab i had values for north, south, and east, but not west. when i created a vlookup to import those values in, west gave n/a instead of 0. which woulda been OK except the main worksheet then tried to calculate a total and average, both of which got messed up b/c of the n/a. what was the right way to tackle this?
    Last edited by zazzz; 11-01-2010 at 12:56 AM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: how to import multiple values w/ a vlookup into a single cell

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  3. #3
    Forum Contributor
    Join Date
    06-21-2009
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    200

    Re: how to import multiple values w/ a vlookup into a single cell

    OK I've put together a sample file with the problem. For simplicity rather than use 2 different sheets I changed 'data tab' to 'data section'.

    So now B2,3,9,10,11 are wrong / not what im looking for. obviously one can manually fix this but with hundreds of lines thats not practical.

    id appreciate the input.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    06-21-2009
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    200

    Re: how to import multiple values w/ a vlookup into a single cell

    hello, anyone?

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to import multiple values w/ a vlookup into a single cell

    By moving the data into separate columns and shortening the strings in column A to just the strings needed to match to the variable data strings in the data section, simple SUMIF() formulas can do all the work.

    =SUMIF(F:F, A2 & "*", G:G)
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Forum Contributor
    Join Date
    06-21-2009
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    200

    Re: how to import multiple values w/ a vlookup into a single cell

    that's awesome, thanks!

    what if we cant change the data around? in this case it was easy b/c there were only a few lines but the test given was to test our abilities. he said there'd be thousands of lines. so if the data was to stay in the same columns how would it work? (in the original example in fact the data was on a separate page).

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to import multiple values w/ a vlookup into a single cell

    If a teacher gives you a question and the data layout is improper, I would point that out along with the correct solution, including the correction to the data layout for simplification.

    Meanwhile, you know you can replace a whole column reference "A:A" with a specific range, right? "A1:A100"

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: how to import multiple values w/ a vlookup into a single cell

    test your abilities? what's that mean?
    oh i know
    " let's google the answer"
    Last edited by martindwilson; 11-07-2010 at 04:51 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Forum Contributor
    Join Date
    06-21-2009
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    200

    Re: how to import multiple values w/ a vlookup into a single cell

    not exactly a teacher, more like a job interview. over there the flexibility is a much less

    and the point of this exercise when they gave it was not to see if i can solve a question involving 10 lines of data - i could have even copy/pasted the solution for that - but to see what i'd do with thousands of lines.

+ 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