Finding value in first cell of rows where value appears within an array

TheBlueMan15

New Member
Joined
Aug 30, 2018
Messages
3
Hi, sorry that my title probably doesn't fit my question correctly, but I didn't know how to describe it.I have a table of document numbers and the other document numbers that are referenced inside:eg document 1 references documents 2, 3 and 4, document 2 references 1 and 3. What I'm looking for is a formula where I put in the document number and it tells me all the documents that it has been referenced in:eg I put in number 3 and it tells me that it was referenced by document 1 and 2.I tried index matching but was getting nowhere.Thanks in advance for the help!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Sorry, wasn't sure how to do that! It's for when a document has a change, I need to be able to see how many documents that refer to it are affected. Here is my example table and expected output :) :

[TABLE="width: 1002"]
<colgroup><col width="87" span="7" style="width: 65pt;"><col width="393" style="width: 295pt;"></colgroup><tbody>[TR]
[TD="class: xl67, width: 87, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: center"]Document #[/TD]
[TD="class: xl67, width: 87, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: center"]Reference 1[/TD]
[TD="class: xl67, width: 87, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: center"]Reference 2[/TD]
[TD="class: xl67, width: 87, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: center"]Reference 3[/TD]
[TD="class: xl67, width: 87, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: center"]Reference 4[/TD]
[TD="class: xl67, width: 87, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ACB9CA]#ACB9CA[/URL] , align: center"]Reference 5[/TD]
[TD="class: xl71, width: 87, align: center"] [/TD]
[TD="class: xl72, width: 393, align: center"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]1[/TD]
[TD="class: xl66, align: center"]2[/TD]
[TD="class: xl66, align: center"]3[/TD]
[TD="class: xl66, align: center"]4[/TD]
[TD="class: xl66, align: center"]5[/TD]
[TD="class: xl66, align: center"]6[/TD]
[TD="class: xl65, align: center"][/TD]
[TD="class: xl68, bgcolor: yellow, align: center"]Changed Document #[/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]2[/TD]
[TD="class: xl66, align: center"]7[/TD]
[TD="class: xl66, align: center"]8[/TD]
[TD="class: xl66, align: center"]9[/TD]
[TD="class: xl66, align: center"]10[/TD]
[TD="class: xl66, align: center"]1[/TD]
[TD="class: xl65, align: center"][/TD]
[TD="class: xl70, align: center"]4[/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]3[/TD]
[TD="class: xl66, align: center"]2[/TD]
[TD="class: xl66, align: center"]4[/TD]
[TD="class: xl66, align: center"]5[/TD]
[TD="class: xl66, align: center"]6[/TD]
[TD="class: xl66, align: center"]7[/TD]
[TD="class: xl65, align: center"][/TD]
[TD="class: xl73, align: center"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]4[/TD]
[TD="class: xl66, align: center"]8[/TD]
[TD="class: xl66, align: center"]9[/TD]
[TD="class: xl66, align: center"]10[/TD]
[TD="class: xl66, align: center"]1[/TD]
[TD="class: xl66, align: center"]2[/TD]
[TD="class: xl65, align: center"][/TD]
[TD="class: xl69, bgcolor: yellow, align: center"]Documents that contain references to changed document[/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]5[/TD]
[TD="class: xl66, align: center"]3[/TD]
[TD="class: xl66, align: center"]4[/TD]
[TD="class: xl66, align: center"]6[/TD]
[TD="class: xl66, align: center"]7[/TD]
[TD="class: xl66, align: center"]8[/TD]
[TD="class: xl65, align: center"][/TD]
[TD="class: xl66, align: center"]1[/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]6[/TD]
[TD="class: xl66, align: center"]9[/TD]
[TD="class: xl66, align: center"]10[/TD]
[TD="class: xl66, align: center"]1[/TD]
[TD="class: xl66, align: center"]2[/TD]
[TD="class: xl66, align: center"]3[/TD]
[TD="class: xl65, align: center"][/TD]
[TD="class: xl66, align: center"]3[/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]7[/TD]
[TD="class: xl66, align: center"]4[/TD]
[TD="class: xl66, align: center"]5[/TD]
[TD="class: xl66, align: center"]6[/TD]
[TD="class: xl66, align: center"]8[/TD]
[TD="class: xl66, align: center"]9[/TD]
[TD="class: xl65, align: center"][/TD]
[TD="class: xl66, align: center"]5[/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]8[/TD]
[TD="class: xl66, align: center"]10[/TD]
[TD="class: xl66, align: center"]1[/TD]
[TD="class: xl66, align: center"]2[/TD]
[TD="class: xl66, align: center"]3[/TD]
[TD="class: xl66, align: center"]4[/TD]
[TD="class: xl65, align: center"][/TD]
[TD="class: xl66, align: center"]7[/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]9[/TD]
[TD="class: xl66, align: center"]5[/TD]
[TD="class: xl66, align: center"]6[/TD]
[TD="class: xl66, align: center"]7[/TD]
[TD="class: xl66, align: center"]8[/TD]
[TD="class: xl66, align: center"]10[/TD]
[TD="class: xl65, align: center"][/TD]
[TD="class: xl66, align: center"]8[/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]10[/TD]
[TD="class: xl66, align: center"]1[/TD]
[TD="class: xl66, align: center"]2[/TD]
[TD="class: xl66, align: center"]3[/TD]
[TD="class: xl66, align: center"]4[/TD]
[TD="class: xl66, align: center"]5[/TD]
[TD="class: xl74, align: center"] [/TD]
[TD="class: xl66, align: center"]10[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Try


[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[TD="bgcolor: #DCE6F1"]
D
[/TD]
[TD="bgcolor: #DCE6F1"]
E
[/TD]
[TD="bgcolor: #DCE6F1"]
F
[/TD]
[TD="bgcolor: #DCE6F1"]
G
[/TD]
[TD="bgcolor: #DCE6F1"]
H
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Document #​
[/TD]
[TD]
Reference 1​
[/TD]
[TD]
Reference 2​
[/TD]
[TD]
Reference 3​
[/TD]
[TD]
Reference 4​
[/TD]
[TD]
Reference 5​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
1​
[/TD]
[TD]
2​
[/TD]
[TD]
3​
[/TD]
[TD]
4​
[/TD]
[TD]
5​
[/TD]
[TD]
6​
[/TD]
[TD][/TD]
[TD]
Changed Document #​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
2​
[/TD]
[TD]
7​
[/TD]
[TD]
8​
[/TD]
[TD]
9​
[/TD]
[TD]
10​
[/TD]
[TD]
1​
[/TD]
[TD][/TD]
[TD]
4​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
3​
[/TD]
[TD]
2​
[/TD]
[TD]
4​
[/TD]
[TD]
5​
[/TD]
[TD]
6​
[/TD]
[TD]
7​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
4​
[/TD]
[TD]
8​
[/TD]
[TD]
9​
[/TD]
[TD]
10​
[/TD]
[TD]
1​
[/TD]
[TD]
2​
[/TD]
[TD][/TD]
[TD]
Documents that contain references to changed document​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD]
5​
[/TD]
[TD]
3​
[/TD]
[TD]
4​
[/TD]
[TD]
6​
[/TD]
[TD]
7​
[/TD]
[TD]
8​
[/TD]
[TD][/TD]
[TD]
1​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
7
[/TD]
[TD]
6​
[/TD]
[TD]
9​
[/TD]
[TD]
10​
[/TD]
[TD]
1​
[/TD]
[TD]
2​
[/TD]
[TD]
3​
[/TD]
[TD][/TD]
[TD]
3​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
8
[/TD]
[TD]
7​
[/TD]
[TD]
4​
[/TD]
[TD]
5​
[/TD]
[TD]
6​
[/TD]
[TD]
8​
[/TD]
[TD]
9​
[/TD]
[TD][/TD]
[TD]
5​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
9
[/TD]
[TD]
8​
[/TD]
[TD]
10​
[/TD]
[TD]
1​
[/TD]
[TD]
2​
[/TD]
[TD]
3​
[/TD]
[TD]
4​
[/TD]
[TD][/TD]
[TD]
7​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
10
[/TD]
[TD]
9​
[/TD]
[TD]
5​
[/TD]
[TD]
6​
[/TD]
[TD]
7​
[/TD]
[TD]
8​
[/TD]
[TD]
10​
[/TD]
[TD][/TD]
[TD]
8​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
11
[/TD]
[TD]
10​
[/TD]
[TD]
1​
[/TD]
[TD]
2​
[/TD]
[TD]
3​
[/TD]
[TD]
4​
[/TD]
[TD]
5​
[/TD]
[TD][/TD]
[TD]
10​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
12
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Array formula in H6 copied down
=IFERROR(INDEX(A$2:A$11,SMALL(IF(MMULT(--(B$2:F$11=$H$3),{1;1;1;1;1})>0,ROW(A$2:A$11)-ROW(A$2)+1),ROWS(H$6:H6))),"")
confirmed with Ctrl+Shift+Enter, not just Enter

Hope this helps

M.
 
Upvote 0
Also, in H6 control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX($A$2:$A$11,SMALL(IF(ISNUMBER(IF($B$2:$F$11=$H$3,$A$2:$A$11)),ROW($A$2:$A$11)-ROW($A$2)+1),ROWS($H$6:H6))),"")
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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