Reputation: 31
I have one large row of data, containing multiple observations. The data consits of: PO number Amount Location
See attached image:
Now what I want is that PO Number 8382 (A2) is looked up in A8:L8 and puts in B2 the amount of each PO number and puts in C2 the location. So what it needs to do, is lookup a value in the row and extract the value on the right of it. I tried H.lookup but that did not work.
Can anyone help me? I used index and match, but I can't make it work. I believe it's probably a simple question but I can't figure it out.
Thank you in advance!
Upvotes: 1
Views: 97
Reputation: 8220
You could use:
=IFERROR(INDIRECT(ADDRESS(8,MATCH(A6,$A$8:$H$8,0)+1)),"PO not found")
using IFERROR you avoid receiving errors if any of the PO not found.
Upvotes: 0
Reputation: 5902
Your thinking is correct.
In cell B2:
=INDEX($A$8:$L$8,1,MATCH($A2,$A$8:$L$8,0)+1)
In cell C2:
=INDEX($A$8:$L$8,1,MATCH($A2,$A$8:$L$8,0)+2)
Copy down.
Upvotes: 1
Reputation: 2055
Try this (It find first occurence in ROW 8)
=OFFSET($A$1;1;MATCH($A2;8:8;0);1;1)
=OFFSET($A$1;1;MATCH($A2;8:8;0)+1;1;1)
Upvotes: 0