+ Reply to Thread
Results 1 to 18 of 18

Drop down list to auto-populate fields and multiplied by another field

  1. #1
    Registered User
    Join Date
    02-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Drop down list to auto-populate fields and multiplied by another field

    Trying to be as simple as possible here. I'm trying to make a helpful ordering tool and I want it to populate for the user based off selection and quantity. I have a sheet that I'm making to help order groceries from a master list of all groceries. For simplicity, I have 4 options I want to select from a drop down list. Attached is my basic reference file:

    example.xlsx

    I need a formula to do the following when the user selects the following from the list:
    1. Food 1 - This should place a "1" under Pizza in the list below
    2. Food 2 - This should place a "1" under Pizza & Tacos in the list below
    3. Food 3 - etc
    4. Food 4 - etc

    I need this this to me multiplied by the quantity column. So if I select Food 1, and select 10 - I need those values multiplied by the quantity volume. I have racked my brain and read probably every article on the web on Vlookup, Macros, etc... I have no idea.

    Any thoughts here? THANK you so much in advance.
    Last edited by semajarab; 02-24-2012 at 03:55 PM. Reason: Solved

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Drop down list to auto-populate fields and multiplied by another field

    So can Food 1 be selected multiple times? and if so, we need to multiply by the total of all Food 1 selection quantities?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Drop down list to auto-populate fields and multiplied by another field

    looking at you example file i dont see wher ethe drop down would be, and im a bit confused as to how the user would use the sheet.. could you include your desired result as well, that might help.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Drop down list to auto-populate fields and multiplied by another field

    Also,

    If you select Food 2 and the Quantity for Food 1 is 10 and for Food 2 it is 5, what should the numbers in the Food 2 row look like in bottom table?

  5. #5
    Registered User
    Join Date
    02-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Drop down list to auto-populate fields and multiplied by another field

    Quote Originally Posted by NBVC View Post
    So can Food 1 be selected multiple times? and if so, we need to multiply by the total of all Food 1 selection quantities?
    Technically I suppose it could be, however I don't need it to. Ideally the person using the sheet would only select Food 1 a single time and then just use the multiplier.

  6. #6
    Registered User
    Join Date
    02-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Drop down list to auto-populate fields and multiplied by another field

    Quote Originally Posted by NBVC View Post
    Also,

    If you select Food 2 and the Quantity for Food 1 is 10 and for Food 2 it is 5, what should the numbers in the Food 2 row look like in bottom table?
    I just modified the sheet, this might help more. Food 1 is just a selection of the first item, Food 2 the first two items, etc. I have put some sample numbers in there to attempt to explain. See amended file. Thank you!! example.xlsx

  7. #7
    Registered User
    Join Date
    02-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Drop down list to auto-populate fields and multiplied by another field

    Quote Originally Posted by DGagnon View Post
    looking at you example file i dont see wher ethe drop down would be, and im a bit confused as to how the user would use the sheet.. could you include your desired result as well, that might help.
    The drop down would be under selection. The user would manually input a whole number for quantity. See the most recent post for a file for a better example. Thank you!! I'm banging my head against the wall trying to figure this out.

  8. #8
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Drop down list to auto-populate fields and multiplied by another field

    if i understand you correctly this should work, i created a sum for each line, then replicated it across the food items, check out the example.
    Attached Files Attached Files

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Drop down list to auto-populate fields and multiplied by another field

    To be safe, I'd use in E8:

    =SUMIF($B$2:$B$5,$C8,$C$2:$C$5)

    copied down.

    Then in each row of column E, copy the formula to the right the desired number of times you want to copy the number...
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    02-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Drop down list to auto-populate fields and multiplied by another field

    Quote Originally Posted by NBVC View Post
    To be safe, I'd use in E8:

    =SUMIF($B$2:$B$5,$C8,$C$2:$C$5)

    copied down.
    Works great! I went ahead and made the drop down menu and it works as well.

    Lastly, what if I want to define Food 1 in a separate location. IE: Food 1 may change very often, and I will be dealing with 2000+ variables. I want to be able to define Food 1 in a separate location and still use the modifier. I attached the sheet again with the drop down list, and a text example of what I'm looking to do. Thank you both again!!! Here: end state request.xlsx

  11. #11
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Drop down list to auto-populate fields and multiplied by another field

    are you meaning that the numbers that are selected for Food 1 would change, so instead of just having totals on Pizza, it may be for example Pizza and Milk that need to be totaled?

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Drop down list to auto-populate fields and multiplied by another field

    See if the attached helps.

    I am assuming only one dropdown selection per your sample.

    I separated you data into separate cells so they can be more easily looked up.... and then applied formula in E8:

    =IF(AND($C8=$B$2,ISNUMBER(MATCH(E$7,INDEX($T$6:$AD$9,MATCH($B$2,$S$6:$S$9,0),0),0))),$C$2,"")

    copied down and across the table.

    you can make the T6:AD9 and S6:S9 ranges as wide as you want to include more possible "food"
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    02-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Drop down list to auto-populate fields and multiplied by another field

    Quote Originally Posted by NBVC View Post
    See if the attached helps.

    I am assuming only one dropdown selection per your sample.

    I separated you data into separate cells so they can be more easily looked up.... and then applied formula in E8:

    =IF(AND($C8=$B$2,ISNUMBER(MATCH(E$7,INDEX($T$6:$AD$9,MATCH($B$2,$S$6:$S$9,0),0),0))),$C$2,"")

    copied down and across the table.

    you can make the T6:AD9 and S6:S9 ranges as wide as you want to include more possible "food"
    This is perfect!! One last thing if you don't mind, what would the code change be if I wanted to have X number of boxes?

  14. #14
    Registered User
    Join Date
    02-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Drop down list to auto-populate fields and multiplied by another field

    Let me clarify. If I was X+ more down down boxes with the same options so people can select Food 1 and Food 4 at the same time.

  15. #15
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Drop down list to auto-populate fields and multiplied by another field

    See attached...

    Modified formula based on possible entries in B2:B5:

    Please Login or Register  to view this content.
    copied across the matrix.
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    02-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Drop down list to auto-populate fields and multiplied by another field

    Perfect!!! You are awesome!! Heading to the Lupus Canada page right now to donate!!

    Thank you so much for the help!!

  17. #17
    Registered User
    Join Date
    02-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Drop down list to auto-populate fields and multiplied by another field

    Marked as solved!!

  18. #18
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Drop down list to auto-populate fields and multiplied by another field

    Quote Originally Posted by semajarab View Post
    Perfect!!! You are awesome!! Heading to the Lupus Canada page right now to donate!!

    Thank you so much for the help!!
    You are very welcome... and thank you!

+ 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