Sum values from arbitrary locations across a worksheet.

Mr_Kay

New Member
Joined
Mar 18, 2025
Messages
15
Office Version
  1. 365
Platform
  1. Windows
I've been building a calculator for a videogame that I play, in which you design and build large, interconnected automation lines using machines and conveyor belts.
Below is an example of a "Recipe Template" (name WIP). It's meant to calculate and organize various values that are representative of the in-game production lines.
The idea is that the user would be able to copy/paste this template arbitrarily around the worksheet, set different recipes, and connect them together in order to help them design their factories before building them.

The Product/min cell (Q55) is meant to be a sum of the cost/min value from all the other recipes that use that part in the cost.
Right now the user is required to manually reference those cells, and if they change to an alternate recipe for the same product, they must change all associated references.
This can get frustrating late game when you're trying to evaluate the effects of different alternates on the rest of your production lines, which could be almost 100 other recipes.
Is there a way to sum those values without directly referencing the cells, given their arbitrary location and prevalence within the worksheet?

I'm trying to accomplish this without the use of another worksheet or VBA, but 3 days of googling, forum surfing, and trolling through Microsoft Support's function documentation hasn't put me any closer to a solution,
and I'll bend if I have to.

Satisfactory Calculator.xlsx
LMNOPQR
53
54Heavy Encased FrameFramesPartper/min
55Product:Heavy Modular Frame33.75
56Machine:ManufacturerBy-product: 
57Amnt. Needed:12Cost:Modular Frame90
58Estimate Power (MW):660Encased Industrial Beam112.5
59Steel Pipe405
60Overage:5.75Concrete247.5
61
Recipe Scale Calculator
Cell Formulas
RangeFormula
O54O54=IF(M54="", "Category", (IF((INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Category", MasterRecipeList[#Headers], 0)))=0, "", (INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Category", MasterRecipeList[#Headers], 0))))))
Q55Q55=N60+W57+Q239
P55P55=IF(M54="", "", (INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Product", MasterRecipeList[#Headers], 0))))
P56P56=IF(M54="", "", (IF((INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("By-Product", MasterRecipeList[#Headers], 0)))=0, "", (INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("By-Product", MasterRecipeList[#Headers], 0))))))
P57P57=IF(M54="", "", (IF((INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 1", MasterRecipeList[#Headers], 0)))=0, "", (INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 1", MasterRecipeList[#Headers], 0))))))
Q57Q57=IF(P57="", "", Q55*((INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 1 / cycle", MasterRecipeList[#Headers], 0)))/(INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Product / cycle", MasterRecipeList[#Headers], 0)))))
P58P58=IF(M54="", "", (IF((INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 2", MasterRecipeList[#Headers], 0)))=0, "", (INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 2", MasterRecipeList[#Headers], 0))))))
Q58Q58=IF(P58="", "", Q55*((INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 2 / cycle", MasterRecipeList[#Headers], 0)))/(INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Product / cycle", MasterRecipeList[#Headers], 0)))))
P59P59=IF(M54="", "", (IF((INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 3", MasterRecipeList[#Headers], 0)))=0, "", (INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 3", MasterRecipeList[#Headers], 0))))))
Q59Q59=IF(P59="", "", Q55*((INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 3 / cycle", MasterRecipeList[#Headers], 0)))/(INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Product / cycle", MasterRecipeList[#Headers], 0)))))
P60P60=IF(M54="", "", (IF((INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 4", MasterRecipeList[#Headers], 0)))=0, "", (INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 4", MasterRecipeList[#Headers], 0))))))
Q60Q60=IF(P60="", "", Q55*((INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Part 4 / cycle", MasterRecipeList[#Headers], 0)))/(INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Product / cycle", MasterRecipeList[#Headers], 0)))))
N56N56=IF(M54="", "", (IF((INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Machine", MasterRecipeList[#Headers], 0)))=0, "", (INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Machine", MasterRecipeList[#Headers], 0))))))
N57N57=IF(M54="", "", Q55/(INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Product / min@100%", MasterRecipeList[#Headers], 0))))
N58N58=IF(N57="", "", (N57*(INDEX(MasterRecipeList, MATCH(M54, MasterRecipeList[Recipe Name], 0), MATCH("Power(MW) @100%", MasterRecipeList[#Headers], 0)))))
Named Ranges
NameRefers ToCells
RecipeNameList='Master Recipe List'!$D$2:$D$16Q57:Q60, N56:N58, P55:P60, O54
Cells with Conditional Formatting
CellConditionCell FormatStop If True
O54Cell Valuecontains "Oil"textNO
O54Cell Valuecontains "Computers"textNO
O54Cell Valuecontains "Motors"textNO
O54Cell Valuecontains "Frames"textNO
O54Cell Valuecontains "Steel"textNO
O54Cell Valuecontains "Native Fauna"textNO
O54Cell Valuecontains "Caterium"textNO
O54Cell Valuecontains "Quartz"textNO
O54Cell Valuecontains "Biofuel"textNO
O54Cell Valuecontains "Concrete"textNO
O54Cell Valuecontains "Copper"textNO
O54Cell Valuecontains "Iron"textNO
Cells with Data Validation
CellAllowCriteria
P55Any value
M54:N54List='Master Recipe List'!$D$2:$D$236
 
I figured it out.

Satisfactory Calculator.xlsx
VW
125Crystal Oscillator48.75
Recipe Scale Calculator
Cell Formulas
RangeFormula
V125V125=IF(S124="", "", (INDEX(MasterRecipeList, MATCH(S124, MasterRecipeList[Recipe Name], 0), MATCH("Product", MasterRecipeList[#Headers], 0))))
W125W125=T130+(SUMIFS(OFFSET(ScaleArea, 0, 1), OFFSET(ScaleArea, 0, -1), "<>Product:", OFFSET(ScaleArea, 0, -1), "<>By-product:", ScaleArea, V125))


'ScaleArea' is a named range that contains all of the recipes.
The formula in W125 works unless it's inside 'ScaleArea', then it gives a circular reference error.
This formula will work inside 'ScaleArea if you enable Iterative Calculation. File --> Options --> Formulas --> Enable Iterative Calculation.
I set the number of iterations to 1, but in theory it shouldn't matter, because the cell itself is excluded in the formula.
 
Upvote 0
Solution
@Mr_Kay
I like to know, Do you mind sharing something like this with your solution, when user changes to alternate recipes using XL2BB
1743063288612.png
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top