×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Finding next assembly in a Indentured PL

Finding next assembly in a Indentured PL

Finding next assembly in a Indentured PL

(OP)
I apologize if this is confusing but try and bear with me.  

I have a Indentured PL in the following format...

    x   y    z
1  0  A1  -
2  1  B1  A1
3  1  B2  A1
4  2  C1  B2
5  3  D1  C1
6  2  C2  B2
7  2  C3  B2
8  1  B3  A1
9  2  CC1 B3

The numbers on the left are line item numbers.
Column x is "indenture level"
Cloumn y is "part number"
Column z is non-existent(this is what I want to create), but will generate "next assembly"

So, B1, B2, B3 Next assemble into A1.  C1, C2, C3 next assemble into B2... and so on.

I can easily identify the next assembly if the part is one cell below its parent using the following.  ("none" was just a filler)
=IF(x2-1=x1,y1,"none") (error in row 1, not a big deal though)

I can also insert yet another IF statement in place of "none", but changeing the =x1 and y1 to its next higher cell... and do that numerous times until it finds the parent part.

However, my PLs are fairly large and would require 100's if not 1000's of IF statements within IF statements to track far enough up the PL to find the parent.  A pretty sloppy solution.

Anyone have a "string" that would incrementally look one cell up until it finds a true condition?

The answer might be pretty trivial but Im pretty inexperienced at this.  

Thanks in advance.

RE: Finding next assembly in a Indentured PL

You just need a helper column.

This doesn't give you exactly what you asked for, but it should get you thinking.

CODE

    x    y    z    helper
1    0    A1    -    
2    1    B1    A1    1
3    1    B2    -    0
4    2    C1    B2    1
5    3    D1    C1    1
6    2    C2    -    0
7    2    C3    -    0
8    1    B3    -    0
9    2    CC1    B3    1


The formula in cell helper2 is =IF(B3=B2+1,1,0)

The formula in cell z2 is =IF(E3=1,C2,"-")

Copy both down

RE: Finding next assembly in a Indentured PL

It would be a lot easier if your list is "upside down" which you might do by sorting on column A in descending order. Then, you can use the following formula in cell D2:
=INDEX(C3:$C$10,MATCH(B2-1,B3:$B$10,0))
and copy it down.
The point is that you cannot easily use a lookup function when the list is not ordered (like your column x), and if you use exact match (like my formula), then you will find the first occurrence that matches exactly - so item 4 will give B1 as a parent, not B2. That is why I had to reverse the list order.

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: Finding next assembly in a Indentured PL

Are you just trying to view the data by level or are you processing the data?  

If you are only viewing it you can use the autofilter capability in Excel.  Select all your data <Ctrl-A> and then click <Data><Filter><AutoFilter>.  You'll see a little arrow at the top of the columns.  Select the arrow on column B and you'll be able to select the level you want to see.  Here is an example for level 1:  

2  1  B1  A1
3  1  B2  A1
8  1  B3  A1

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources