Populate column with the parent part number using an Excel formula.

JDJohnson8783

New Member
Joined
Jul 5, 2023
Messages
10
Office Version
  1. 365
Platform
  1. Windows
I need some help please. I am looking for a excel formula that will determine the parent of a child based off a number/period outline on sheet 1 (yellow column sheet 1 "Item No.") and take the part number of the parent (orange column sheet 1 or yellow column sheet 2) and populate a column with the parent part number (green column sheet 2).

Sheet 1 looks like this:

Screenshot 2023-07-05 150237.png


Sheet 2 looks like this:

Screenshot 2023-07-05 150315.png


I need the parent part number to be placed into the row of the child in the parent column. Ideally the parent part number will match the part number on sheet 2 rather than sheet 1. If it is easier to pull the parent part number from sheet 1 I can concatenate the last 2 characters that are in sheet 2.

Please let me know if you have any questions. Been working on this for 4 days.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Posting a picture isn't any help when others try to use your data. Please use XL2BB to show the samples. It would also help if you could show a few expected results.
 
Upvote 0
Posting a picture isn't any help when others try to use your data. Please use XL2BB to show the samples. It would also help if you could show a few expected results.
Sorry about that..... I have completed what you asked. Please see below.

Here is sheet 1:

Copy of 230322-1.xlsm
ABCDEFGHIJK
5Item No.Part No.DescriptionQty.UMDispo.
61D-001-045-033B & S Journal Bearing1EARepair
71.148270Outer Shell1EAReuse
81.248200Journal Pad Assembly1STRepair
91.2.148189Journal Pad 4EARepair
101.2.244928Support Ball5EAReuse
111.3B-025-045-054Instrumented Journal Pad1EARepair
121.3.1B-027-266RTD (Single)2EANew
131.448229End Seal1EAReuse
141.548231Floating Seal1EAReuse
151.605414Support Shim5EAReuse
161.705413Adjustment Shim5EANew
171.8M6x1.0 x 10mm Lg.DIN 7984 S.H.C.S.5EANew
181.9M4x0.7 x 8mm Lg.DIN 7984 S.H.C.S.8EANew
191.1026945Pad Retainer Screw5EAReuse
201.1193475A250McMASTER Stainless Steel Washer5EANew
211.12M6x1.0 x 25mm Lg.S.H.C.S.2EANew
221.13M6 x 24mm Lg.DIN 9798 Taper Pin2EANew
23
24
25
26
Engineering Release
Cells with Data Validation
CellAllowCriteria
I6:J62ListEA,ST
K6:K62ListModify,New,Repair,Reuse,Ref.


And Here is sheet 2:

Cell Formulas
RangeFormula
G2:G21G2=IF(ISBLANK('Engineering Release'!G6),"",'Engineering Release'!G6)
H2:I21H2=IF(ISBLANK('Engineering Release'!I6:J6),"",'Engineering Release'!I6:J6)
O2:O21O2=IF('Engineering Release'!A6<>"",LEN(SUBSTITUTE('Engineering Release'!A6,".",""))-1,"")
P2:P21P2=IF(ISBLANK('Engineering Release'!G6),"","HO")
A2:A21A2=IF('Engineering Release'!K6:K6="Repair",CONCATENATE('Engineering Release'!B6:B6,".R"),IF('Engineering Release'!K6:K6="Reuse",CONCATENATE('Engineering Release'!B6:B6,".U"),IF('Engineering Release'!K6:K6="Modify",CONCATENATE('Engineering Release'!B6:B6,".M"),IF('Engineering Release'!K6:K6="Ref.",CONCATENATE('Engineering Release'!B6:B6,".F"),IF('Engineering Release'!K6:K6="New",CONCATENATE('Engineering Release'!B6:B6,".N"), "")))))
C2:F21C2=IF(ISBLANK('Engineering Release'!C6:F6), "", 'Engineering Release'!C6:F6)
J2:K21J2=IF(ISBLANK('Engineering Release'!I6:J6),"",'Engineering Release'!I6:J6)
L2:L21L2=IF(ISBLANK('Engineering Release'!G6),"",IF(O2=0, "M",IF(O2>0, "F","")))
S2:S18S2=LET(PART_ORIG,A2, PART,IFERROR(MID(PART_ORIG,1,FIND("-",PART_ORIG)-1),PART_ORIG), OUTLINE,'Engineering Release'!$A$6:$A$31, PARTS,'Engineering Release'!$C$6:$C$31, PARENT,IF(NOT(ISNUMBER(FIND(".",OUTLINE))), OUTLINE,LEFT(OUTLINE,LEN(OUTLINE)-2)), IDENTIFY_PARENT,XLOOKUP(PART,PARTS,PARENT,"",0), PARENT_PART,XLOOKUP(IDENTIFY_PARENT,OUTLINE,PARTS,"",0), TEXT(PARENT_PART,"0"))
S19:S21S19=IFERROR(XLOOKUP(O19-1,$O$2:$O19,$A$2:$A19,"",0,1),"")
U2:U21U2=IF(ISBLANK('Engineering Release'!C6),"",IF(O2=0,"",IF(U1="","100",IF(U1>100,U1+100,""))))
Dynamic array formulas.


There are 62 rows that employees can fill out all together on this form.
 
Upvote 0
I think I and other are trying to make sense out of this.
 
Upvote 0
Is this what you need
Excel Formula:
=XLOOKUP(TEXTBEFORE(A2,".",-1,,1),'Engineering Release'!$B$2:$B$18&"",'Engineering Release'!$A$2:$A$18)
 
Upvote 0
I think I and other are trying to make sense out of this.
So let me see if I can simplify it:
- Sheet 1 will autofill everything you see in sheet 2 that has data but it is missing the parent column being auto filled which is what I am looking to get a code to do.
- The parent column should populate with the parent part number to the child row.
- The top-level parent should not have anything in the parent column as it is the top parent.
- The part number in Column B Sheet 1 and the part number in Column A sheet 2 are the same except on sheet 2 the part number adds a "." and a letter to the end based off the Dispo. in column K sheet 1. This is for BOM/Router purposes to keep the different types of BOM's separate for each part number as each part number can be manufactured or repaired etc. and this designates the correct steps of work involved.
- The Item Number in Sheet 1 Column A is the outline that designates who the parent is of what child in the hierarchy. 1, 1.1, 1.2, 1.2.1, etc....
- formula in sheet 2 column S (Parent) is what I have tried and where I want the parent number to populate. I need to use column A on sheet 1 to determine who the parent is.

Please let me know if this helps.... I am desperate to get this to work. I appreciate any and all help I can get.
 
Upvote 0
Ok, it sounds as though you do not have the latest updates which came out in January.
Are these the expected values
Cell Formulas
RangeFormula
A2:A14A2=IF('Engineering Release'!K6:K6="Repair",CONCATENATE('Engineering Release'!B6:B6,".R"),IF('Engineering Release'!K6:K6="Reuse",CONCATENATE('Engineering Release'!B6:B6,".U"),IF('Engineering Release'!K6:K6="Modify",CONCATENATE('Engineering Release'!B6:B6,".M"),IF('Engineering Release'!K6:K6="Ref.",CONCATENATE('Engineering Release'!B6:B6,".F"),IF('Engineering Release'!K6:K6="New",CONCATENATE('Engineering Release'!B6:B6,".N"), "")))))
S2:S14S2=XLOOKUP(TEXTBEFORE(A2,".",-1,,1),'Engineering Release'!$B$2:$B$18&"",'Engineering Release'!$A$2:$A$18)
 
Upvote 0
Ok, it sounds as though you do not have the latest updates which came out in January.
Are these the expected values
Cell Formulas
RangeFormula
A2:A14A2=IF('Engineering Release'!K6:K6="Repair",CONCATENATE('Engineering Release'!B6:B6,".R"),IF('Engineering Release'!K6:K6="Reuse",CONCATENATE('Engineering Release'!B6:B6,".U"),IF('Engineering Release'!K6:K6="Modify",CONCATENATE('Engineering Release'!B6:B6,".M"),IF('Engineering Release'!K6:K6="Ref.",CONCATENATE('Engineering Release'!B6:B6,".F"),IF('Engineering Release'!K6:K6="New",CONCATENATE('Engineering Release'!B6:B6,".N"), "")))))
S2:S14S2=XLOOKUP(TEXTBEFORE(A2,".",-1,,1),'Engineering Release'!$B$2:$B$18&"",'Engineering Release'!$A$2:$A$18)
The results should look like this:

Cell Formulas
RangeFormula
S2:S14S2=IFERROR(XLOOKUP(O2-1,$O$2:$O2,$A$2:$A2,"",,-1),"")
A2:A18A2=IF('Engineering Release'!K6:K6="Repair",CONCATENATE('Engineering Release'!B6:B6,".R"),IF('Engineering Release'!K6:K6="Reuse",CONCATENATE('Engineering Release'!B6:B6,".U"),IF('Engineering Release'!K6:K6="Modify",CONCATENATE('Engineering Release'!B6:B6,".M"),IF('Engineering Release'!K6:K6="Ref.",CONCATENATE('Engineering Release'!B6:B6,".F"),IF('Engineering Release'!K6:K6="New",CONCATENATE('Engineering Release'!B6:B6,".N"), "")))))


Based off this outline.
Copy of 230322-1.xlsm
AB
5Item No.Part No.
61D-001-045-033
71.148270
81.248200
91.2.148189
101.2.244928
111.3B-025-045-054
121.3.1B-027-266
131.448229
141.548231
151.605414
161.705413
171.8M6x1.0 x 10mm Lg.
181.9M4x0.7 x 8mm Lg.
191.1026945
201.1193475A250
211.12M6x1.0 x 25mm Lg.
221.13M6 x 24mm Lg.
Engineering Release
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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