Okay, this is going to be a bit long, sorry!
In general terms, I'm looking to create a spreadsheet that adds up the total quantities of things from multiple different sheets in the same workbook, but only when those sheets are selected on a checked list.
In more specific terms, every year I make a huge amount of holiday cookies, and I want to be able to have all my recipes in one place, one per sheet, and then be able to select from a list which specific cookies I want to make this year, and have my spreadsheet total up the amount of each ingredient I need for those cookies in my Shopping List. I'm stuck on how to make my calculations only include specific recipes when the checkboxes are checked.
What I currently have:
Every recipe follows the same format, so it's easy to reference cells from sheet to sheet
My shopping list page has a spot for me to input the number of gift bags I'm making, and then that number is referenced by each recipe, and those sheets tell me the number of batches I need to make for each type of cookie to get the desired quantity of that cookie
On the page Shopping List, I have a box "Number of Gift Bags" (Shopping List Calculator!J3) and then each recipe has the Quantity per Batch ([Recipe Name]!F4) and # per bag ([Recipe Name]!G4) as manual input, and then on the recipe I have it calculating the Bags per Batch (H4=F4/G4) and then Batches Needed is calculated by
=CEILING(('Shopping List Calculator'!J3/H4),1)So that way I get the number of batches needed as the next whole number rounded up.
I can make it so the shopping list has the total for each ingredient for all cookies at once by having
([Recipe Name]![Ingredient Quantity] * [Recipe Name]!Batches Needed) + ([Next Recipe]![Ingredient Quantity] * [Next Recipe]!Batches Needed), etc,but that's very cumbersome and I know there's probably a cleaner way to do this.
I'm also trying to make a Quick Chart page that lists each cookie name, the number of batches, the total amount of flour, sugar, eggs, and misc other ingredients. I can make it do that by manually inputting the cookie name and then having each specific ingredient listed out by
='[Recipe Name]'![Ingredient Quantity]*'[Recipe Name]'!Batches Neededand then having the Misc ingredients listed out by
=TEXTJOIN(", ", TRUE, '[Recipe Name]'!A20:A49)where
A20:A49are the cells where misc ingredients would be listed, if any, but again, I think I might be doing things too manually and making them too complicated.
I think there's probably some CountIf function I can use in combination with checkboxes to get what I want.
On Shopping List!, I have a list called "Cookies Being Made This Year" that has check boxes in one column, and the name of the cookie in the next column.
What I think I need to do is have each cookie name be a reference to the specific recipe sheet, and then use the Checkboxes as a True value for a CountIf function, and then I'm stuck, and I feel like I'm missing something very obvious so I don't have to have a function within a function within a function here.
For a very abbreviated example of the data I'm working with:
Sheet: Shopping List
| Number of Gift Bags |
|---|
| 300 |
| Ingredient | Quantity | Unit |
|---|---|---|
| Flour | --- | lbs |
| Sugar | --- | lbs |
| Eggs | --- | ea |
| Chocolate Chips | --- | oz |
| Ginger | --- | g |
| Cinnamon | --- | g |
| White Chocolate Chunks | --- | oz |
| Macadamia Nuts | --- | oz |
Goal of Shopping List: To be able to calculate total quantity of each ingredient needed as pulled from recipe sheets, including miscellaneous ingredients which are different for every recipe, and standard ingredients (flour, sugar, eggs, oil, butter, etc.) I've abbreviated the list above to make it shorter, since the formulas will be the same for 3 ingredients and 30 ingredients. Ideally, there will be some way to have recipes included/excluded without needing to rewrite the formulas (I'm making this spreadsheet to be used by relatives who are even less tech-literate than myself.)
Sheet: Quick Chart
| Cookie Name | Flour | Sugar | Eggs | Misc | Batches needed |
|---|---|---|---|---|---|
| Chocolate Cookie | 6 | 4 | 4 | Chocolate Chips | 4 |
| Ginger Cookie | 8 | 8 | 6 | Ginger, Cinnamon | 6 |
| Sugar Cookie | 6 | 8 | 8 | 4 | |
| White Choc Nut | 3 | 2 | 4 | white chocolate chunks, nuts | 3 |
Goal of Quick Chart: Have the total quantity of each ingredient for each cookie listed, as well as which miscellaneous ingredients are used for that recipe (quantity doesn't need to be included), and the number of batches being made of that type of cookie. Real sheet currently only has Ginger Cookie data added to it.
Sheet: Chocolate Cookie
Recipe and quantity of each ingredient, as well as number of batches needed to make target amount of cookies.
Sheet: Ginger Cookie
Recipe and quantity of each ingredient, as well as number of batches needed to make target amount of cookies.
Sheet: Sugar Cookie
Recipe and quantity of each ingredient, as well as number of batches needed to make target amount of cookies.
Sheet: White Chocolate Nut Cookie
Recipe and quantity of each ingredient, as well as number of batches needed to make target amount of cookies.
Link to spreadsheet in Google Drive, though I am working in Excel. https://docs.google.com/spreadsheets/d/1oAB33p-wj1Yrtj6O8q_FAA7bYw-6u2R0tER2ncu4-xg/edit?usp=drivesdk
REDUCE()function to iterate all sheets mentioned in list then do few operation with data of those mentioned sheets. You may share a sample google-sheet with dummy data.