+ Reply to Thread
Results 1 to 4 of 4

vlookup with multiple duplicate values

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    35

    vlookup with multiple duplicate values

    I have a data sheet "main page" formatted like this:

    Attachment 189817

    And another sheet "cost list" with data formatted like this:

    Attachment 189818

    The main page uses the cost list sheet in a vlookup to input cost data back to the main sheet.

    The problem I'm having has to do with multiple items ordered from the same buyer (highlighted in green) and how I add correct cost data since there will be duplicate names with differing cost data on the cost list. A straight vlookup will only return the first value.

    Since the cost amount and customer name is currently the ONLY identifying information available on the cost list, I figure the best way to do this is to combine the rows with the same buyer name and add the cost data together (let me know if you have a better idea). Then do the same on the main page with the price (revenue) columns. Then process the vlookup which provides the total cost of the order to the main page.

    How do I do this as a part of a macro?

    Finally, is there a way to change the product column to "combined order" and simultaneously add a comment which has all individual Products listed?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: vlookup with multiple duplicate values

    unless you want to take the chance of being sent a picture of your solution, i would suggest you upload the sample workbook, not a picture of it
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

    Re: vlookup with multiple duplicate values

    have you tried sumifs
    "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

  4. #4
    Registered User
    Join Date
    10-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: vlookup with multiple duplicate values

    Quote Originally Posted by FDibbins View Post
    unless you want to take the chance of being sent a picture of your solution, i would suggest you upload the sample workbook, not a picture of it
    Pretty basic workbook, the file is too large...running into problems. And yeah I'd take a chance with a picture...as long as its of code...better than nothing.

    Quote Originally Posted by martindwilson View Post
    have you tried sumifs
    I haven't, the only thing is the solution would need to reformat all the rows and stuff too. I was hoping for a macro solution...still learning macros.

+ 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