Create an Excel Part Number Generator with Drop-Down Lists
Question details
Create a nine-digit part number from selected characteristics and use it to look up part details.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user selects part characteristics from drop-down lists and needs their assigned codes combined into a searchable part number.
- Observed behavior
- Each selection should contribute its assigned code to a nine-digit part number, which can then be used to retrieve matching part details.
Decide which characteristics make up the part number and assign each option a unique three-digit code within its characteristic. Format the code cells as Text before entering values so codes such as 001 retain their leading zeros.
Build drop-down lists and combine their lookup codes
Use this approach to generate a nine-digit number from three characteristics and look up an existing part record.
This example uses three three-digit codes. Adjust the tables and formula if your part-number structure uses different code lengths.
Keep the descriptor and code pairs in the same order in each lookup table. The generated part number is text, which preserves leading zeros.
On a worksheet, enter descriptors and their three-digit text codes in H2:I20 for the first characteristic, J2:K20 for the second, and L2:M20 for the third. Use only the rows needed and make each descriptor unique within its table.
Select A2, open Data > Data Validation, choose List, and set the source to the populated descriptor cells in column H. Repeat for C2 using column J and E2 using column L.
In B2, enter =IFERROR(VLOOKUP(A2,$H$2:$I$20,2,FALSE),""). In D2, enter =IFERROR(VLOOKUP(C2,$J$2:$K$20,2,FALSE),""). In F2, enter =IFERROR(VLOOKUP(E2,$L$2:$M$20,2,FALSE),"").
In G2, enter =IF(OR(LEN(B2)<>3,LEN(D2)<>3,LEN(F2)<>3),"",B2&D2&F2). Select an option in each drop-down; G2 displays the combined number only when all three codes have three characters.
Create a part table with nine-digit text numbers in P2:P100 and corresponding descriptions in Q2:Q100. In H2 on a separate results sheet, or another empty cell outside the lookup tables, enter =IFERROR(VLOOKUP(G2,$P$2:$Q$100,2,FALSE),"Not found"). Adjust the sheet references if the part table is on another sheet.

Create the same part number generator in WPS Spreadsheet
Use WPS Spreadsheet to create characteristic drop-downs, retrieve their codes, and combine them into a nine-digit part number.
- 1. Enter characteristic tables: Open WPS Spreadsheet and enter descriptors with three-digit codes in three two-column tables, such as H:I, J:K, and L:M. Format the code columns as Text before entering the codes.
- 2. Create the drop-downs: Select A2 and use Data > Data Validation to create a List from the first descriptor range. Repeat in C2 and E2 for the other two descriptor ranges.
- 3. Look up each code: In B2, enter =IFERROR(VLOOKUP(A2,$H$2:$I$20,2,FALSE),""). Use the same formula pattern in D2 and F2, referring to C2 and J:K, then E2 and L:M.
- 4. Combine and use the number: In G2, enter =IF(OR(LEN(B2)<>3,LEN(D2)<>3,LEN(F2)<>3),"",B2&D2&F2). Use G2 as the lookup value in a VLOOKUP formula against a table of text-formatted part numbers and descriptions.

Frequently Asked Questions
How do I keep leading zeros in a part code?
Select the source code cells and set their format to Text before entering codes such as 001. Store existing nine-digit part numbers as text too, so lookups match.
Why is the generated part number blank?
Check the selections in A2, C2, and E2 and their lookup results in B2, D2, and F2. The example formula leaves G2 blank if any retrieved code is missing or is not exactly three characters long.
How can I add another option to a drop-down list?
Add the descriptor and its three-digit code to the appropriate lookup table. Then open Data > Data Validation for the selection cell and expand the list source if the new row is outside the existing range. Expand the VLOOKUP range too if needed.
Why does a part-number lookup return Not found?
Check that the generated number exists in the first column of the lookup table and that both values are stored as text. Also confirm that the VLOOKUP range includes the matching row.




