+ Reply to Thread
Results 1 to 8 of 8

Problem figuring out a formula using VLOOKUP?

  1. #1
    Registered User
    Join Date
    03-09-2018
    Location
    Lees Summit, Missouri
    MS-Off Ver
    2016
    Posts
    3

    Question Problem figuring out a formula using VLOOKUP?

    Hello,

    I am trying to automate some order forms. Product Sheet is a list of products and quantities. Product-Parts Sheet shows which parts and quantities are needed for each product. I would like for the Parts Order Sheet to calculate the number of each part I need to order based on the product quantity and part quantity per product. Products have multiple parts and parts can be in multiple products.

    What I need my formula to return is the following:
    (quantity of p1 for product A) * (quantity of Product A) +
    (quantity of p1 for product B) * (quantity of Product B) +
    (quantity of p1 for product C) * (quantity of Product C) +
    (quantity of p1 for product D) * (quantity of Product D) +
    and so on for all values matching (p1)

    It seems like it might be a nested VLOOKUP function?


    Product Sheet
    Product Quantity
    A 2
    B 5
    C 3
    D 8

    Product-Parts Sheet
    Product Part Quantity
    A p1 1
    A p2 2
    A p3 1
    B p1 2
    B p3 1
    C p3 1
    C p4 3
    C p5 2
    D p2 1

    Parts Order Sheet
    part part quantity
    p1 12
    p2 12
    p3 10
    p4 9
    p5 6
    Attached Files Attached Files
    Last edited by watkins656; 03-09-2018 at 10:13 AM. Reason: Dont know how to format tables

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Problem figuring out a formula using VLOOKUP?

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    03-09-2018
    Location
    Lees Summit, Missouri
    MS-Off Ver
    2016
    Posts
    3

    Re: Problem figuring out a formula using VLOOKUP?

    Done! I uploaded the attachment to the post

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Problem figuring out a formula using VLOOKUP?

    The easiest-to-maintain solution involves a helper column:

    E11, copied down: =SUMPRODUCT(($A$3:$A$6=A11)*$B$3:$B$6)*C11

    and E24, copied down: =SUMIF($B$11:$B$19,A24,$E$11:$E$19)
    Attached Files Attached Files

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem figuring out a formula using VLOOKUP?

    Try this:

    B24 =SUMPRODUCT(SUMIFS(C$11:C$19,B$11:B$19,A24,A$11:A$19,A$3:A$6)*B$3:B$6)

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem figuring out a formula using VLOOKUP?

    Assuming that the ranges will be increasing, I would put your data into tables and then use a formula such as this:

    B2 of 'Parts Order' worksheet =SUMPRODUCT(SUMIFS(Table2[Quantity],Table2[Part],A2,Table2[Product],Table1[Product])*Table1[Quantity])

    See attachment for clarification.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-09-2018
    Location
    Lees Summit, Missouri
    MS-Off Ver
    2016
    Posts
    3

    Re: Problem figuring out a formula using VLOOKUP?

    dude... my hero!

    Thanks!!!!

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem figuring out a formula using VLOOKUP?

    Glad we could help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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] figuring out how to use offset on top of vlookup
    By ammartino44 in forum Excel General
    Replies: 12
    Last Post: 05-05-2015, 01:14 PM
  2. How do you calculate Square Foot in a formula
    By icevinson in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-16-2014, 02:58 AM
  3. Replies: 2
    Last Post: 04-03-2014, 08:53 PM
  4. Replies: 1
    Last Post: 03-06-2014, 03:58 PM
  5. Problem with figuring this out?
    By widow in forum Excel General
    Replies: 3
    Last Post: 11-03-2006, 07:14 PM
  6. Need help with figuring out a formula please
    By DavidJ726 in forum Excel General
    Replies: 5
    Last Post: 05-29-2006, 11:25 PM
  7. Problem figuring formula
    By MarthaMartha in forum Excel General
    Replies: 2
    Last Post: 02-15-2006, 09:15 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