我正在尝试匹配两个超过 10k 行的不同 Excel 工作表中的全名

问题描述 投票:0回答:1

电子表格 A 是存储我所有数据的主电子表格 - 大约 10k 行 电子表格 B 是辅助电子表格,其中存储特定事物的数据 - 大约 5k 行

电子表格 A 和电子表格 B 在 C 列上都有全名列,我想识别电子表格 A 上所有匹配的全名,但很难做到这一点。我尝试使用下面的代码:

=VLOOKUP(C16,工作表1!A15:L3867,3,FALSE)

(是的,该列从第 16 行开始)

我没有任何运气,觉得我可能把这件事复杂化了。 VLOOKUP 是正确的方法吗?最后,有没有办法对所有匹配的名称进行颜色编码?

谢谢。

excel excel-formula match
1个回答
0
投票

使用 VLOOKUP 的方向是正确的,但有一些事情需要检查并可能需要调整:

1.  Range and Lookup Column: You mentioned that the full name is in column C for both sheets. However, in your formula, you’re referencing Sheet1!A15:L3867, which starts in column A, but VLOOKUP requires the lookup value (in your case, the full name) to be in the first column of the range. If your full name is in column C, you need to adjust the range to start at column C.

2.  Column Index: The third argument in VLOOKUP (currently 3) specifies which column to return a value from within the range. If you’re looking for matches, you may just want to return a simple value (e.g., the full name or a flag). If the matching full name is in column C and you just want to return a flag or indication of a match, change this to 1 to return the full name.

这是修改后的公式:

=VLOOKUP(C16,工作表 1!C15:C3867,1,FALSE)

此公式在 Sheet1!C15:C3867 范围内的单元格 C16 中查找全名,如果找到则返回匹配的名称。如果不匹配,则会返回错误(表示不匹配)。

使用 MATCH 的替代方法

如果您只关心两个工作表中是否存在某个名称,则可以使用 MATCH 而不是 VLOOKUP。 MATCH 对于检查某个范围内的值是否存在通常更简单:

=IF(ISNUMBER(MATCH(C16,Sheet1!C15:C3867,0)), "匹配", "不匹配")

如果 Sheet1!C15:C3867 范围内存在 C16 中的全名,则返回“匹配”,否则返回“不匹配”。

让我知道这是否适合您的设置!

© www.soinside.com 2019 - 2024. All rights reserved.