Apr 13 2024 11:25 AM - edited Apr 13 2024 11:29 AM
Hello,
I've got a nutrition calculator that I want to be able to have auto fill with the nutrition facts from another sheet. Kicker is I have multiple sheets with different recipes. So I need to be able to select a recipe from my drop down list (b2 on my ingredients tab), then have the nutrition fact generate from that recipe's tab.
Apr 13 2024 01:43 PM
I figured out this formula =IFS(Biscuits!B1=B2,Biscuits!B2:I12,Test!B1=B2,Test!B2:I12,TRUE,"") which works. If there is better way let me know. I would rather not have to add to the formula every time I add a recipe.
Apr 13 2024 11:16 PM
Your approach using the IFS function works, but it requires manually updating the formula each time you add a new recipe tab. Instead, you can use the INDIRECT function combined with the VLOOKUP function to dynamically reference the appropriate recipe tab based on the selection in cell B2.
Here is how you can do it:
=IFERROR(VLOOKUP(A2,INDIRECT("'"&$B$2&"'!A:I"),COLUMN(B2),FALSE),"")
In this formula:
With this setup, you won't need to manually update the formula when you add new recipe tabs. Just ensure that the item names are consistent across all recipe tabs. The text was created with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and Like it!
This will help all forum participants.
Apr 14 2024 01:18 AM
@ThayerT The fact that "Biscuits!B2:I12" works for you, means that you can spill an entire range of cells in one go. Add the fact that you also seem to use structured tables to hold your recipes, you may want to try the following.
Add a Total column to each recipe table and give each table a name that is equal to one that you will include in the drop down list.
Now you can return the entire table in one go based on the value in B2 and it doesn't matter where the table sits in your workbook as Excel looks for a table with that specific name.
=INDIRECT(B2&"[#All]")