Automatic part numbering using excel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I currently have an assembly (unitised façade modules) with several extruded components. These components and a number of features on these components are driven by a series of parameters passed to the parts from the top level assembly. At the moment I am creating an script with a bunch of ugly if statements within each component to assign the part numbers, and retrieve a suitable part number if such a part exists. If it does not exist, it returns an error and I have to manually create a new if statement to cover the new instance. It's useful for lots of repetition since most parts get covered quickly but when there are hundreds or thousands of variants, it gets a little messy.
Ideally the part numbers and relevant parameters for these components will be stored on an external spreadsheet hidden in the backend. So if a component exists with all matching parameters, the appropriate part number is used. And if the component does not have matching parameters, then a new entry is added to the table and the appropriate part number if created.
So far I am able to retrieve the values based on a single known parameter (for example if I manually type in the part number I can retrieve all of the relevant parameters) however since I actually want to return the part number when the values of multiple parameters match I am stuck. I believe the term would be nested indexing. I can also successfully create new entries in the spreadsheet by counting the number of blank cells and subtracting that to find the next blank row, then populating that row with the known parameters.
TLDR: I want to return a value from a spreadsheet row if multiple values in the same row match.
I believe Excel itself would use an indexed match. like so. https://exceljet.net/formula/index-and-match-with-multiple-criteria