+ Reply to Thread
Results 1 to 4 of 4

How to change data depending on a drop down list

  1. #1
    Registered User
    Join Date
    06-26-2022
    Location
    Spain
    MS-Off Ver
    2019
    Posts
    2

    How to change data depending on a drop down list

    Hi,

    Last days I've been trying to make from scratch a macronutrient diet-calculator but I don't really have the skills to make it work without help. I have listed all the food that I want to include in my calculator with all their protein, carbohydrate and fat.

    eTi9zGR.png

    Next to that there are 5 meals with 5 ingredients each one, where you can select each ingredient from a drop down list to make your meal based on what you have at home. After you choose each ingredient, you type down the amount in grams you want to assign.

    H1lzZQp.png

    Here comes the problem. Below all of this there is a "hidden" zone of calculations. In this zone I need to calculate every macronutrient of every ingredient separately, and then add them all up to show it clean and easy upwards. I was doing this:

    =IFS($C3=$P4;$C4*Q4/100;$C3=$P5;$C4*Q5/100;$C3=$P6;$C4*Q6/100;$C3=$P7;$C4*Q7/100;$C3=$P8;$C4*Q8/100;$C3=$P9;$C4*Q9/100;$C3=$P10;$C4*Q10/100)

    It was super tedious but it was working until I realised there is like a 130 argument limit and I had over 200 ingredients. I don't really know how to tell Excel to choose this amount of protein instead of that one based on what is the ingredient chosen on the drop down list. I hope I made myself clear, it's my first time writing in an english forum so is a bit complicated. Thanks in advance

    zZ4j2xh.png
    Attached Files Attached Files
    Last edited by yeristex; 06-26-2022 at 01:02 PM.

  2. #2
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365
    Posts
    1,219

    Re: How to change data depending on a drop down list

    Welcome to the Excel Forum.

    Try in D49 and copy (drag) across and down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Good luck!

  3. #3
    Registered User
    Join Date
    06-26-2022
    Location
    Spain
    MS-Off Ver
    2019
    Posts
    2

    Re: How to change data depending on a drop down list

    Thank you a lot! It works amazing

  4. #4
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365
    Posts
    1,219

    Re: How to change data depending on a drop down list

    You're welcome. Glad to help.
    Thank you for the feedback and for the reputation added.
    Have a blessed day!

+ 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] Colour change depending on drop down list
    By Davidbraico in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-10-2018, 02:23 AM
  2. [SOLVED] Need help having a drop down list change multiple cells depending on the list selection
    By jennis7242 in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 08-12-2017, 01:20 PM
  3. Change cell content depending on selection from drop down list
    By mack4n in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-16-2015, 04:17 AM
  4. Replies: 1
    Last Post: 04-03-2015, 06:00 PM
  5. [SOLVED] Create List depending on data in Drop Down
    By Raanan in forum Excel General
    Replies: 6
    Last Post: 08-13-2013, 07:59 AM
  6. Automatically select data depending on what's chosen in a drop-down list
    By Cormentia in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-24-2011, 11:55 AM
  7. Replies: 1
    Last Post: 04-11-2005, 01:06 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