+ Reply to Thread
Results 1 to 7 of 7

Vlookup and find the total for a part number

  1. #1
    Registered User
    Join Date
    06-08-2006
    Location
    Portland, OR
    MS-Off Ver
    Micro Soft XP, Excel 2003
    Posts
    97

    Vlookup and find the total for a part number

    Hi

    I have a spreadsheet with thousands of lines and need to easily be able to do a Vlookup and return the total of each part number.

    I have tried using the data subtotal option, but I receive the first amount instead of the total.

    Part number in row A
    count in row B

    I need a to return a total for each part number and do a Vlookup to put that amount into another worksheet.


    Thanks

    Lostinformulas

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try

    =VLOOKUP(A1,'Main Sheet'!$A:$B,2,FALSE)

    Where A1 in summary sheet say is the part number you want to find

    Change 'Main Sheet' to your sheet name

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    06-08-2006
    Location
    Portland, OR
    MS-Off Ver
    Micro Soft XP, Excel 2003
    Posts
    97

    Vlookup

    VBA Noob

    Column B also houses the indivual counts, how will the look return the total?

    Lostinformulas

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Argh,

    It's a summary page your after,

    Try this

    Assumes the code you want to sum total of is starts in A1.
    Again change sheets names as required

    =SUMPRODUCT(--('Main Sheet'!A2:A10000=Summary!A1)*('Main Sheet'!B2:B10000))


    VBA Noob

  5. #5
    Registered User
    Join Date
    06-08-2006
    Location
    Portland, OR
    MS-Off Ver
    Micro Soft XP, Excel 2003
    Posts
    97

    Vlookup and find the total for a part number

    VBA Noob

    Yes I want a summary sheet.

    I tried the formula, I'm not sure what I did wrong.

    Where do I need to put the sum product formula, in a different sheet.

    Currently the sheet that houses my part numbers is label Sheet 1.

    Sheet 1 has many part numbers, how will this formula display the totals for all of the part numbers?

    Lostinformula

    Now you can see how I came up with my screen name.

  6. #6
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    assuming that the list of part numbers and counts are in columns a and b on sheet1, and the part number to be summed is in cell a1 of main sheet

    =SUMPRODUCT((sheet1!A2:A10000='main sheet'!A1)*(sheet1!B2:B10000))
    not a professional, just trying to assist.....

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    You can use Data>Filter>Advanced Filter to get your list for the summary sheet.

    "Copy to a new location" and "Unique records only"


    Filtering Tutorial at Debra Dalgleish's site.......
    http://www.contextures.on.ca/tiptech.html

    Then enter this in B1 on your summary sheet

    =SUMPRODUCT(--(Sheet1!A2:A10000=Summary!A1)*(Sheet1!B2:B10000))

    If the summary sheet is still sheet2 then use this

    =SUMPRODUCT(--(Sheet1!A2:A10000=Sheet2!A1)*(Sheet1!B2:B10000))

    VBA Noob

+ 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