Struggling trying to bring in value using Lookup or Index Match

desibouy

Board Regular
Joined
Nov 20, 2014
Messages
98
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am trying to automate some of my product upload CSV files, I have the below in Columns A to C.


Code:
[TABLE="width: 615"]
<tbody>[TR]
[TD]Item Name[/TD]
[TD][/TD]
[TD]Matrix Type[/TD]
[TD][/TD]
[TD]Sub-Item of[/TD]
[/TR]
[TR]
[TD]Test 1 - Main Item[/TD]
[TD][/TD]
[TD]Parent[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test a[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test b[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test c[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test 2 - Main Item[/TD]
[TD][/TD]
[TD]Parent[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test I[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test II[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test 3 - Main Item[/TD]
[TD][/TD]
[TD]Parent[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test Z[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test Y[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test W[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I would like to find all the parent item and bring in the value of the Main item next to all the childs but want the Parent itself blank, like so -

Code:
[TABLE="width: 652"]
<tbody>[TR]
[TD]Item Name[/TD]
[TD][/TD]
[TD]Matrix Type[/TD]
[TD][/TD]
[TD]Sub-Item of[/TD]
[/TR]
[TR]
[TD]Test 1 - Main Item[/TD]
[TD][/TD]
[TD]Parent[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test a[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD]Test 1 - Main Item[/TD]
[/TR]
[TR]
[TD]Test b[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD]Test 1 - Main Item[/TD]
[/TR]
[TR]
[TD]Test c[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD]Test 1 - Main Item[/TD]
[/TR]
[TR]
[TD]Test 2 - Main Item[/TD]
[TD][/TD]
[TD]Parent[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test I[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD]Test 2 - Main Item[/TD]
[/TR]
[TR]
[TD]Test II[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD]Test 2 - Main Item[/TD]
[/TR]
[TR]
[TD]Test 3 - Main Item[/TD]
[TD][/TD]
[TD]Parent[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Test Z[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD]Test 3 - Main Item[/TD]
[/TR]
[TR]
[TD]Test Y[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD]Test 3 - Main Item[/TD]
[/TR]
[TR]
[TD]Test W[/TD]
[TD][/TD]
[TD]Child[/TD]
[TD][/TD]
[TD]Test 3 - Main Item[/TD]
[/TR]
</tbody>[/TABLE]

This basically says - This child item is part of this Matrix Item - so when adding add all these Child items to the Parent.


I have tried using Index Match, Vlookup and combination of if lookups but I can't get it to work :(

please can some-one help me?

Thanks
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
This should work:


Excel 2010
ABCDE
1Item NameMatrix TypeSub-Item of
2Test 1 - Main ItemParent 
3Test aChildTest 1 - Main Item
4Test bChildTest 1 - Main Item
5Test cChildTest 1 - Main Item
6Test 2 - Main ItemParent
7Test IChildTest 2 - Main Item
8Test IIChildTest 2 - Main Item
9Test 3 - Main ItemParent
10Test ZChildTest 3 - Main Item
11Test YChildTest 3 - Main Item
12Test WChildTest 3 - Main Item
Sheet1
Cell Formulas
RangeFormula
E2=IF(C2<>"Parent",INDEX($A$1:A1,SUMPRODUCT(MAX(($C$1:C1="Parent")*(ROW($C$1:C1))))),"")
 
Upvote 0
Hi,

FYI there is no empty columns in my sheet I had entered them so it's easy to read on here.

Thanks for the formula but that only gives me 0's?

========= Edit

Got it working, Thank you!!!! Thank you!!!! Thank you!!!! Thank you!!!! You're a lifesaver!! :D
 
Upvote 0
Hi,

FYI there is no empty columns in my sheet I had entered them so it's easy to read on here.

Thanks for the formula but that only gives me 0's?

========= Edit

Got it working, Thank you!!!! Thank you!!!! Thank you!!!! Thank you!!!! You're a lifesaver!! :D

You're Welcome.
 
Upvote 0

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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