Returning Cell Value to Different Cell Based on Criteria

Cat129

Board Regular
Joined
Oct 20, 2012
Messages
96
I'm not sure how to explain what I need so hopefully the cells below explain. I have created some dummy data similar to what I need.

I'm trying to create a formula to go into the parent column (G) that will return the value from the part number column (B) of the parent above. All parents are a level 5. I have completed Column G to show you what I would like the end result to be

Any help would be really appreciated as I have been trying with index match using the level (Column D) as a reference and nothing I try works.

The solution can be in VB or a regular formula as this is an automated sheet which will all be coded eventually.

Thank You
Cat

BCDEFG
Part NumberRevisionLevelQtyDescriptionParent
Parent 1151AssemblyParent 1
1261Part of AboveParent 1
2162AssemblyParent 1
3271Part of AboveParent 1
Parent 2251AssemblyParent 2
4164Part of AboveParent 2
5168Part of AboveParent 2
Parent 3151AssemblyParent 3
6162Part of AboveParent 3
7164Part of AboveParent 3

<tbody>
</tbody>
 
Last edited:

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Put this formula in cell G2 and copy down...

=IF(D2=5,B2,G1)

Hey Rick, Thanks for the response, unfortunately I dont think this will work. What happens when I get to D6 or D9? The formula would then be providing the wrong parent.

In the actual data parents have between 1 and over 300 child components within them, the amount of children also changes with each update so the formula would need to be dynamic
 
Last edited:
Upvote 0
Hey, Sorry. Was being thick. Yes this does work. I was trying to over complicate things.

Thank You for your help
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

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