"Sort by" Formula

Melaccio

New Member
Joined
May 21, 2019
Messages
13
Hi everyone,

I am tring to integrate in my formula some data more to make an automatic order in the cell but I don't have no clue how to solve it.:confused:

For example if I want to match two column with this formula =IF(ISERROR(VLOOKUP(C2,$A$2:$A$6,1,0)),"",C2), the result will be like this:





[TABLE="width: 262"]
<tbody>[TR]
[TD="colspan: 2"][TABLE="width: 289"]
<tbody>[TR]
[TD][TABLE="width: 463"]
<tbody>[TR]
[TD]Table array 1[/TD]
[TD][/TD]
[TD="colspan: 2"]lookup value[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]subject 1[/TD]
[TD][/TD]
[TD]subject 10[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]subject 2[/TD]
[TD][/TD]
[TD]subject 5[/TD]
[TD][/TD]
[TD]subject 5[/TD]
[/TR]
[TR]
[TD]subject 3[/TD]
[TD][/TD]
[TD]subject 9[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]subject 4[/TD]
[TD][/TD]
[TD]subject 1[/TD]
[TD][/TD]
[TD]subject 1[/TD]
[/TR]
[TR]
[TD]subject 5[/TD]
[TD][/TD]
[TD]subject 2[/TD]
[TD][/TD]
[TD]subject 2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

However, if I want that the formula will give me an automatic order, like this:

<style><!--table {mso-displayed-decimal-separator:"\,"; mso-displayed-thousand-separator:"\.";}@page {margin:.75in .7in .75in .7in; mso-header-margin:.3in; mso-footer-margin:.3in;}td {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;}--></style>[TABLE="width: 87"]
<tbody>[TR]
[TD="width: 87"]subject 5[/TD]
[/TR]
[TR]
[TD]subject 1[/TD]
[/TR]
[TR]
[TD]subject 2[/TD]
[/TR]
</tbody>[/TABLE]


What should I integrate in more?

Thank you in advance guys!:biggrin:
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Maybe...


[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]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Table array 1​
[/TD]
[TD][/TD]
[TD]
lookup value​
[/TD]
[TD][/TD]
[TD]
List​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
subject 1​
[/TD]
[TD][/TD]
[TD]
subject 10​
[/TD]
[TD][/TD]
[TD]
subject 5​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
subject 2​
[/TD]
[TD][/TD]
[TD]
subject 5​
[/TD]
[TD][/TD]
[TD]
subject 1​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
subject 3​
[/TD]
[TD][/TD]
[TD]
subject 9​
[/TD]
[TD][/TD]
[TD]
subject 2
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
subject 4​
[/TD]
[TD][/TD]
[TD]
subject 1​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD]
subject 5​
[/TD]
[TD][/TD]
[TD]
subject 2​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
7
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Formula in E2 copied down
=IFERROR(INDEX(C$2:C$6,AGGREGATE(15,6,(ROW(C$2:C$6)-ROW(C$2)+1)/ISNUMBER(MATCH(C$2:C$6,A$2:A$6,0)),ROWS(E$2:E2))),"")

M.
 
Last edited:
Upvote 0
Maybe...


[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]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Table array 1​
[/TD]
[TD][/TD]
[TD]
lookup value​
[/TD]
[TD][/TD]
[TD]
List​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
subject 1​
[/TD]
[TD][/TD]
[TD]
subject 10​
[/TD]
[TD][/TD]
[TD]
subject 5​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
subject 2​
[/TD]
[TD][/TD]
[TD]
subject 5​
[/TD]
[TD][/TD]
[TD]
subject 1​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
subject 3​
[/TD]
[TD][/TD]
[TD]
subject 9​
[/TD]
[TD][/TD]
[TD]
subject 2
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
subject 4​
[/TD]
[TD][/TD]
[TD]
subject 1​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD]
subject 5​
[/TD]
[TD][/TD]
[TD]
subject 2​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
7
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Formula in E2 copied down
=IFERROR(INDEX(C$2:C$6,AGGREGATE(15,6,(ROW(C$2:C$6)-ROW(C$2)+1)/ISNUMBER(MATCH(C$2:C$6,A$2:A$6,0)),ROWS(E$2:E2))),"")

M.

Hi Branco,

Thank you for your quick answer.
The formula seems working but if I want to add a new table array, what should i do?

For example:

[TABLE="width: 519"]
<colgroup><col span="3"><col span="2"></colgroup><tbody>[TR]
[TD]Table array 1[/TD]
[TD][/TD]
[TD]table array 2[/TD]
[TD][/TD]
[TD]lookup value[/TD]
[/TR]
[TR]
[TD]subject 1[/TD]
[TD][/TD]
[TD]subject f[/TD]
[TD][/TD]
[TD]subject n[/TD]
[/TR]
[TR]
[TD]subject 2[/TD]
[TD][/TD]
[TD]subject p[/TD]
[TD][/TD]
[TD]subject 5[/TD]
[/TR]
[TR]
[TD]subject 3[/TD]
[TD][/TD]
[TD]subject n[/TD]
[TD][/TD]
[TD]subject 9[/TD]
[/TR]
[TR]
[TD]subject 4[/TD]
[TD][/TD]
[TD]subject l[/TD]
[TD][/TD]
[TD]subject 1[/TD]
[/TR]
[TR]
[TD]subject 5[/TD]
[TD][/TD]
[TD]subject z[/TD]
[TD][/TD]
[TD]subject 2
[/TD]
[/TR]
</tbody>[/TABLE]

I tried to add in the formula a second match like this:

=IFERROR(INDEX(E$2:E$6;AGGREGATE(15,6,(ROW(E$2:E$6)-ROW(E$2)+1)/MATCH(E$2:E$6,A$2:A$6,0),MATCH($E$2:$E$6,$C$2:$C$6,0)),ROWS(G$2:G2)),"")

but I receive as a result only the subject 1.

Do you have any clue?

Thank you again :biggrin:
 
Upvote 0
Expected results?

M.

I expect that formula will match by ordering all the criteria of the column "vlookup" between the two table arrays.
So in my case it should be:

<style><!--table {mso-displayed-decimal-separator:"\,"; mso-displayed-thousand-separator:"\.";}@page {margin:.75in .7in .75in .7in; mso-header-margin:.3in; mso-footer-margin:.3in;}td {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;}--></style>[TABLE="width: 87"]
<!--StartFragment--> <colgroup><col width="87" style="width:65pt"> </colgroup><tbody>[TR]
[TD="width: 87"]subject n[/TD]
[/TR]
[TR]
[TD]subject 5[/TD]
[/TR]
[TR]
[TD]subject 1[/TD]
[/TR]
[TR]
[TD]subject 2[/TD]
[/TR]
<!--EndFragment--></tbody>[/TABLE]


To match multiple table array I am using this formula:

=IF(ISERROR(VLOOKUP(E2,$A$2:$A$6,1,0)),IF(ISERROR(VLOOKUP(E2,$C$2:$C$6,1,0)),"",E2),E2)

but since you show me a better way how to make order with one table array I would like to know how to use this procedure with one table array more.
 
Upvote 0
Try


[Table="class: grid"][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][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td]
Table array 1​
[/td][td][/td][td]
table array 2​
[/td][td][/td][td]
lookup value​
[/td][td][/td][td]
List​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
subject 1​
[/td][td][/td][td]
subject f​
[/td][td][/td][td]
subject n​
[/td][td][/td][td]
subject n​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
subject 2​
[/td][td][/td][td]
subject p​
[/td][td][/td][td]
subject 5​
[/td][td][/td][td]
subject 5​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
subject 3​
[/td][td][/td][td]
subject n​
[/td][td][/td][td]
subject 9​
[/td][td][/td][td]
subject 1​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
5
[/td][td]
subject 4​
[/td][td][/td][td]
subject l​
[/td][td][/td][td]
subject 1​
[/td][td][/td][td]
subject 2​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
6
[/td][td]
subject 5​
[/td][td][/td][td]
subject z​
[/td][td][/td][td]
subject 2​
[/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
7
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]


Formula in G2 copied down
=IFERROR(INDEX(E$2:E$6,AGGREGATE(15,6,(ROW(E$2:E$6)-ROW(E$2)+1)/(ISNUMBER(MATCH(E$2:E$6,A$2:A$6,0))+ISNUMBER(MATCH(E$2:E$6,C$2:C$6,0))),ROWS(G$2:G2))),"")

M.
 
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]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Table array 1​
[/TD]
[TD][/TD]
[TD]
table array 2​
[/TD]
[TD][/TD]
[TD]
lookup value​
[/TD]
[TD][/TD]
[TD]
List​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
subject 1​
[/TD]
[TD][/TD]
[TD]
subject f​
[/TD]
[TD][/TD]
[TD]
subject n​
[/TD]
[TD][/TD]
[TD]
subject n​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
subject 2​
[/TD]
[TD][/TD]
[TD]
subject p​
[/TD]
[TD][/TD]
[TD]
subject 5​
[/TD]
[TD][/TD]
[TD]
subject 5​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
subject 3​
[/TD]
[TD][/TD]
[TD]
subject n​
[/TD]
[TD][/TD]
[TD]
subject 9​
[/TD]
[TD][/TD]
[TD]
subject 1​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
subject 4​
[/TD]
[TD][/TD]
[TD]
subject l​
[/TD]
[TD][/TD]
[TD]
subject 1​
[/TD]
[TD][/TD]
[TD]
subject 2​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD]
subject 5​
[/TD]
[TD][/TD]
[TD]
subject z​
[/TD]
[TD][/TD]
[TD]
subject 2​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
7
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Formula in G2 copied down
=IFERROR(INDEX(E$2:E$6,AGGREGATE(15,6,(ROW(E$2:E$6)-ROW(E$2)+1)/(ISNUMBER(MATCH(E$2:E$6,A$2:A$6,0))+ISNUMBER(MATCH(E$2:E$6,C$2:C$6,0))),ROWS(G$2:G2))),"")

M.

Thank you a lot Branco. The formula it's working perfect.
However when I am trying with long table array the formula is including the duplicate, for example in this case:

[TABLE="width: 693"]
<colgroup><col span="3"><col span="4"></colgroup><tbody>[TR]
[TD]Table array 1[/TD]
[TD][/TD]
[TD]table array 2[/TD]
[TD][/TD]
[TD="colspan: 2"]lookup value[/TD]
[TD]List[/TD]
[/TR]
[TR]
[TD]subject 1[/TD]
[TD][/TD]
[TD]subject f[/TD]
[TD][/TD]
[TD]subject n[/TD]
[TD][/TD]
[TD]subject n[/TD]
[/TR]
[TR]
[TD]subject 2[/TD]
[TD][/TD]
[TD]subject p[/TD]
[TD][/TD]
[TD]subject 5[/TD]
[TD][/TD]
[TD]subject 5[/TD]
[/TR]
[TR]
[TD]subject 3[/TD]
[TD][/TD]
[TD]subject n[/TD]
[TD][/TD]
[TD]subject w[/TD]
[TD][/TD]
[TD]subject 1[/TD]
[/TR]
[TR]
[TD]subject 4[/TD]
[TD][/TD]
[TD]subject l[/TD]
[TD][/TD]
[TD]subject 1[/TD]
[TD][/TD]
[TD]subject 2[/TD]
[/TR]
[TR]
[TD]subject 5[/TD]
[TD][/TD]
[TD]subject t[/TD]
[TD][/TD]
[TD]subject 2[/TD]
[TD][/TD]
[TD]subject e[/TD]
[/TR]
[TR]
[TD]subject 6[/TD]
[TD][/TD]
[TD]subject a[/TD]
[TD][/TD]
[TD]subject e[/TD]
[TD][/TD]
[TD]subject e[/TD]
[/TR]
[TR]
[TD]subject 7[/TD]
[TD][/TD]
[TD]subject b[/TD]
[TD][/TD]
[TD]subject e[/TD]
[TD][/TD]
[TD]subject 6[/TD]
[/TR]
[TR]
[TD]subject 8[/TD]
[TD][/TD]
[TD]subject c[/TD]
[TD][/TD]
[TD]subject 6[/TD]
[TD][/TD]
[TD]subject 4[/TD]
[/TR]
[TR]
[TD]subject 9[/TD]
[TD][/TD]
[TD]subject d[/TD]
[TD][/TD]
[TD]subject 4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]subject 10[/TD]
[TD][/TD]
[TD]subject e[/TD]
[TD][/TD]
[TD]subject s[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]subject 11[/TD]
[TD][/TD]
[TD]subject e[/TD]
[TD][/TD]
[TD]subject w[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Do you know how to complete the formula by excluding the duplicate?
From data-remove duplicate I can do it manually, but I am trying to make in automatic.

Thank you again for your help and sorry if I am annoying you.
 
Upvote 0
To make things easier I suggest you remove manually the duplicates in lookup value column. But if this is not possible, try...


[Table="class: grid"][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][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td]
Table array 1​
[/td][td][/td][td]
table array 2​
[/td][td][/td][td]
lookup value​
[/td][td][/td][td]
List​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
subject 1​
[/td][td][/td][td]
subject f​
[/td][td][/td][td]
subject n​
[/td][td][/td][td]
subject n​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
subject 2​
[/td][td][/td][td]
subject p​
[/td][td][/td][td]
subject 5​
[/td][td][/td][td]
subject 5​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
subject 3​
[/td][td][/td][td]
subject n​
[/td][td][/td][td]
subject w​
[/td][td][/td][td]
subject 1​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
5
[/td][td]
subject 4​
[/td][td][/td][td]
subject l​
[/td][td][/td][td]
subject 1​
[/td][td][/td][td]
subject 2​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
6
[/td][td]
subject 5​
[/td][td][/td][td]
subject t​
[/td][td][/td][td]
subject 2​
[/td][td][/td][td]
subject e​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
7
[/td][td]
subject 6​
[/td][td][/td][td]
subject a​
[/td][td][/td][td]
subject e​
[/td][td][/td][td]
subject 6​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
8
[/td][td]
subject 7​
[/td][td][/td][td]
subject b​
[/td][td][/td][td]
subject e​
[/td][td][/td][td]
subject 4​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
9
[/td][td]
subject 8​
[/td][td][/td][td]
subject c​
[/td][td][/td][td]
subject 6​
[/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
10
[/td][td]
subject 9​
[/td][td][/td][td]
subject d​
[/td][td][/td][td]
subject 4​
[/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
11
[/td][td]
subject 10​
[/td][td][/td][td]
subject e​
[/td][td][/td][td]
subject s​
[/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
12
[/td][td]
subject 11​
[/td][td][/td][td]
subject e​
[/td][td][/td][td]
subject w​
[/td][td][/td][td][/td][/tr]
[/table]


Formula in G2 copied down
=IFERROR(INDEX(E$2:E$12,AGGREGATE(15,6,(ROW(E$2:E$12)-ROW(E$2)+1)/(ISNA(MATCH(E$2:E$12,G$1:G1,0))*(ISNUMBER(MATCH(E$2:E$12,A$2:A$12,0))+ISNUMBER(MATCH(E$2:E$12,C$2:C$12,0)))),1)),"")

M.
 
Upvote 0
To make things easier I suggest you remove manually the duplicates in lookup value column. But if this is not possible, 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]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Table array 1​
[/TD]
[TD][/TD]
[TD]
table array 2​
[/TD]
[TD][/TD]
[TD]
lookup value​
[/TD]
[TD][/TD]
[TD]
List​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
subject 1​
[/TD]
[TD][/TD]
[TD]
subject f​
[/TD]
[TD][/TD]
[TD]
subject n​
[/TD]
[TD][/TD]
[TD]
subject n​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
subject 2​
[/TD]
[TD][/TD]
[TD]
subject p​
[/TD]
[TD][/TD]
[TD]
subject 5​
[/TD]
[TD][/TD]
[TD]
subject 5​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
subject 3​
[/TD]
[TD][/TD]
[TD]
subject n​
[/TD]
[TD][/TD]
[TD]
subject w​
[/TD]
[TD][/TD]
[TD]
subject 1​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
subject 4​
[/TD]
[TD][/TD]
[TD]
subject l​
[/TD]
[TD][/TD]
[TD]
subject 1​
[/TD]
[TD][/TD]
[TD]
subject 2​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD]
subject 5​
[/TD]
[TD][/TD]
[TD]
subject t​
[/TD]
[TD][/TD]
[TD]
subject 2​
[/TD]
[TD][/TD]
[TD]
subject e​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
7
[/TD]
[TD]
subject 6​
[/TD]
[TD][/TD]
[TD]
subject a​
[/TD]
[TD][/TD]
[TD]
subject e​
[/TD]
[TD][/TD]
[TD]
subject 6​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
8
[/TD]
[TD]
subject 7​
[/TD]
[TD][/TD]
[TD]
subject b​
[/TD]
[TD][/TD]
[TD]
subject e​
[/TD]
[TD][/TD]
[TD]
subject 4​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
9
[/TD]
[TD]
subject 8​
[/TD]
[TD][/TD]
[TD]
subject c​
[/TD]
[TD][/TD]
[TD]
subject 6​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
10
[/TD]
[TD]
subject 9​
[/TD]
[TD][/TD]
[TD]
subject d​
[/TD]
[TD][/TD]
[TD]
subject 4​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
11
[/TD]
[TD]
subject 10​
[/TD]
[TD][/TD]
[TD]
subject e​
[/TD]
[TD][/TD]
[TD]
subject s​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
12
[/TD]
[TD]
subject 11​
[/TD]
[TD][/TD]
[TD]
subject e​
[/TD]
[TD][/TD]
[TD]
subject w​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Formula in G2 copied down
=IFERROR(INDEX(E$2:E$12,AGGREGATE(15,6,(ROW(E$2:E$12)-ROW(E$2)+1)/(ISNA(MATCH(E$2:E$12,G$1:G1,0))*(ISNUMBER(MATCH(E$2:E$12,A$2:A$12,0))+ISNUMBER(MATCH(E$2:E$12,C$2:C$12,0)))),1)),"")

M.

Hi Branco,

Thank you again for your answers.
I tried this formula but it's not working.
I also put each column in different sheet:

Sheet1: Table array 1
Sheet2: Table array 2
Sheet3: Lookup value
Sheet4: List

I use the formula that you show me by changing the criteria and put all the column since I need all the column A for all sheet but excluding the A1 cell.
The formula it's like this:

=IFERROR(INDEX(Sheet3!$A:$A,AGGREGATE(15,6,(ROW(Sheet3!$A:$A) ROW(Sheet3!$A$2)+1)/(ISNUMBER(MATCH(Sheet3!$A:$A,Sheet1!$A:$A,0))+ISNUMBER(MATCH(Sheet3!$A:$A,Sheet2!$A:$A,0))),ROWS(Sheet3!A1))),"")

The results it's only lookup value for all the column A in the Sheet4.
Do you have any ideas?
 
Upvote 0
You are changing the criteria, the location of the data and where the results should be shown many times. Difficult to understand exactly what you really want.

Please, try to show exactly where are the data (worksheet, rows and columns) and we should avoid using references to entire columns, like A: A, for the sake of performance.

M.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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