简体   繁体   English

有没有办法在 Excel 中自动执行 VLOOKUP?

[英]Is there a way to automate VLOOKUP in Excel?

I have an excel table with column 1 like a,b,c,a,d,e,a,b and column 2 with some numbers 1,2,3,4,5... I use vlookup to scan the table for say 'a' and give its corresponding number which returns the value for the first instance of a.我有一个 excel 表,第 1 列如 a,b,c,a,d,e,a,b 和第 2 列有一些数字 1,2,3,4,5...我使用 vlookup 扫描表格说 'a' 并给出其相应的数字,该数字返回 a 的第一个实例的值。

How do I make excel return it for the next time a is mentioned?如何让 excel 在下次提到 a 时返回它? It is a huge table and I cannot modify the array each time.这是一个巨大的表格,我不能每次都修改数组。

To extract the corresponding numbers for each instance "a", just write:要为每个实例“a”提取相应的数字,只需编写:

=FILTER(B2:B100,A2:A100="a")

If you want the nth instance, that's as easy as writing:如果你想要第 n 个实例,就像写一样简单:

=INDEX(FILTER(B2:B100,A2:A100="a"),nth)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM