Home > Net >  Excel return nth value from table
Excel return nth value from table

Time:08-27

I am using O365 Excel. I am trying a filter formula. I need to return the next item that matches and so fourth. Currently I get a spill error once it matches once.

ids | amt
1099 109917001
1100 110012001
1100 110014001
1100 110016001

Expected
id = 1099 amt =109917001
id = 1100 amt =110012001
id = 1100 amt =110014001
id = 1100 amt =110016001

So id.1099 returns 109917001 on row 1.
Id.1100 should return 110012001 on row 2.
Id.1100 should return 110014001 on row 3.
Id.1100 should return 110016001 on row 4.

Here is my code so far =UNIQUE(FILTER(A2:B2306,A2:A2306=D2,"No result"))

CodePudding user response:

Use INDEX:

=INDEX(FILTER(B:B,D2=A:A),COUNTIF($D$2:D2,D2))

enter image description here

CodePudding user response:

Thanks to @servers who pointed out it was a spill over on my end. Thanks solarmike and Scott Craner for helping too.

  • Related