Nested Information

jomiscli

Board Regular
Joined
Feb 27, 2012
Messages
53
Office Version
  1. 365
Platform
  1. Windows
Hey guys.

I am currently working on a crafting recipe helper for a game I play. The general idea is to have a drop down menu where you can select the recipe you want to craft, select how many you want to craft, and then get a total of all the raw uncrafted materials you would need to make said query. All I have right now is a table of all the basic raw materials seperated by type and rarity. Heres an example:

Common StoneRare StoneCommon WoodRare WoodCommon MetalRare MetalCommon CraftedRare Crafted
QuartzRubyOakBeechBronzePlatinumOak PanelBeech Shield Panel
GraniteDiamondMapleAshSteelGoldBronze HandleGold Handle

There are quite a few more in my table but this is the gist. The issue I ran into was when rarer items needed common items to be crafted. I can't figure out how to give the Gold Handle its value by drawing a value from the Bronze Handle.

Bronze Handle
Uncrafted ItemsAmount
Bronze1
Oak1

Gold Handle
Uncrafted ItemsAmountCrafted ItemsAmount
Gold1Bronze Handle1
Ash1

The further down the rarity tree you go, you end up needing 3-4 recipes and basic materials to craft the next item. I can't find a good way to do this. Would making a small table like above be a good way to store the material value of the item while also being able to use it with other recipes to add its value to it? If so how would I use tables to use that info in such a way? I thought I was doing ok but then my math keep being wrong and I can't seem to find a decent way to set my tables up to handle info nesting like that.

I hope this makes sense, I tried to be as clear as possible without making to long of a post.

Any help is appreciated!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hey guys.

I am currently working on a crafting recipe helper for a game I play. The general idea is to have a drop down menu where you can select the recipe you want to craft, select how many you want to craft, and then get a total of all the raw uncrafted materials you would need to make said query. All I have right now is a table of all the basic raw materials seperated by type and rarity. Heres an example:

Common StoneRare StoneCommon WoodRare WoodCommon MetalRare MetalCommon CraftedRare Crafted
QuartzRubyOakBeechBronzePlatinumOak PanelBeech Shield Panel
GraniteDiamondMapleAshSteelGoldBronze HandleGold Handle

There are quite a few more in my table but this is the gist. The issue I ran into was when rarer items needed common items to be crafted. I can't figure out how to give the Gold Handle its value by drawing a value from the Bronze Handle.

Bronze Handle
Uncrafted ItemsAmount
Bronze1
Oak1

Gold Handle
Uncrafted ItemsAmountCrafted ItemsAmount
Gold1Bronze Handle1
Ash1

The further down the rarity tree you go, you end up needing 3-4 recipes and basic materials to craft the next item. I can't find a good way to do this. Would making a small table like above be a good way to store the material value of the item while also being able to use it with other recipes to add its value to it? If so how would I use tables to use that info in such a way? I thought I was doing ok but then my math keep being wrong and I can't seem to find a decent way to set my tables up to handle info nesting like that.

I hope this makes sense, I tried to be as clear as possible without making to long of a post.

Any help is appreciated!
What it seems that you have here is Manufacturing Resource Planning (MRP) where items (recipies it seems in your case) are made up of individual parts and assemblies and these assemblies can be made up other assemblies and or individual parts. To set up MRP you will need to compile a Bill of Materials. I can help you do this.

Does this seem about right?

What version of Excel are you using? Can you please update your profile with this information.

There is another ongoing Post at the moment that is getting quite complicated because the tree is huge but this does not look as complicated.
 
Upvote 0
Hello. I have updated my profile information. I am currently using Excel 365.

Yes you are correct.

I pretty much changed how I was doing everything last night. I compiled all the info I had into one large table with columns for the crafted items, and then rows for the resource items. Where a crafted item and a resource item met I would enter the amount needed to make the item in that column and then I used =IF(ISNUMBER(Table2[Bronze Handle]), Table2[Bronze Handle], "") and =IF(ISNUMBER(Table2[Bronze Handle]), Table2[Resource Row Column], ""). These basically give me the amount of a resource and the name of that resource as a return. This doesn't currently work with items that require other crafted items because I can't figure out how to extract the value of the previously crafted item and still keep the amount of that item thats needed.

Thank you for your response!!
 
Upvote 0
Hello. I have updated my profile information. I am currently using Excel 365.

Yes you are correct.

I pretty much changed how I was doing everything last night. I compiled all the info I had into one large table with columns for the crafted items, and then rows for the resource items. Where a crafted item and a resource item met I would enter the amount needed to make the item in that column and then I used =IF(ISNUMBER(Table2[Bronze Handle]), Table2[Bronze Handle], "") and =IF(ISNUMBER(Table2[Bronze Handle]), Table2[Resource Row Column], ""). These basically give me the amount of a resource and the name of that resource as a return. This doesn't currently work with items that require other crafted items because I can't figure out how to extract the value of the previously crafted item and still keep the amount of that item thats needed.

Thank you for your response!!
It is good that you are using 365 as it has some very useful functions.

Can you post some data?

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

I've found a Bill Of Materials structure like this is necessary and then some VBA code with recursive calling to drill down to as many levels as the BOM demands. There is a limit ro
recursive calls in Excel VBA though but this looks quite simple and won't reach that number.

Nested Information.xlsm
ABCDE
1ParentParent TypeChildChild TypeQuantity
2Product 1ProductAssembly 1Assembly2
3Product 1ProductAssembly 3Assembly1
4Assembly 1AssemblyPart 1Part4
5Assembly 1AssemblyPart 2Part1
6Assembly 1AssemblyAssembly 2Assembly6
7Assembly 2AssemblyPart 4Part1
8Assembly 2AssemblyPart 5Part3
9Assembly 3AssemblyPart 6Part1
10Assembly 3AssemblyPart 7Part1
11Assembly 3AssemblyPart 8Part1
12Assembly 3AssemblyPart 9Part2
13Product 2ProductAssembly 2Assembly1
14Product 2ProductAssembly 4Assembly5
15Product 2ProductPart 10Part2
16Assembly 4AssemblyPart 4Part4
17Assembly 4AssemblyPart 8Part1
BOM (2)
 
Upvote 0
ResourcesBronze HandleGold Handle---------------------------------------------------------------------------------------->insert formula 1insert formula 2
Bronze11Bronze
Oak11Oak
| | |
| | |
Gold1 | |
Ash1 | |
| | |
\/ | |
Bronze Handle1 \/ \/

I apologize, I'll have to look into the XL2BB Addin soon! For now this is all I got I should be able to check it out later on today.

The table above is really a direct representation of what I have so far. I had to scrap what I was doing before to get here.

=IF(ISNUMBER(Table2[Bronze Handle]), Table2[Bronze Handle], "") this goes in formula 1

=IF(ISNUMBER(Table2[Bronze Handle]), Table2[Resources], "") this goes into formula 2

The bold and italic Bronze Handle would be linked to a control form with either a drop down menu, list, or something with all of the header columns as an option. When you select a specific column header (which are all of the crafted items in the game) it will automatically show the resource value of that item.

Obviously I plan to make a much neater sheet that would eventually show all this information with the ability to increase how many you want to build and eventually to multiple items at once.

I don't have anything for returning values for already crafted items in the resource column. I am not sure if those will even work there but last night it seemed like a good idea and then I just couldn't get anything out of it so I had to scrap what I was using as it wasn't making sense anymore.
 
Upvote 0
Yeah I dont know I am completely lost here. Thanks for the help.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,155
Members
453,021
Latest member
Justyna P

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