我的第一张纸
Customer_Email
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
在第二张纸上
ID Customer_Email
1058 [email protected]
771 [email protected]
601 [email protected]
619 [email protected]
459 [email protected]
418 [email protected]
590 [email protected]
557 [email protected]
226 [email protected]
702 [email protected]
21 [email protected]
362 [email protected]
1005 [email protected]
167 aasshok[email protected]
966 [email protected]
560 [email protected]
我需要sheet2到sheet1对应的ID
下面是我在sheet1的B2 Cell中使用的
=VLOOKUP(A2,Sheet2!A$2:B$1000,1,0)
返回 N/A 并且错误显示
Did not find value '[email protected]' in VLOOKUP evaluation.
根据 VLOOKUP 语法 - 值的搜索发生在范围的第一列中。在您的公式中,VLOOKUP 尝试在
'[email protected]'
列中查找值 Sheet2!A$2:A1000
,但显然无法在那里找到它,因为该文本在 Sheet2!B$2:B1000
范围内
在 Google Sheets 中,您可以使用以下公式
=ARRAYFORMULA(VLOOKUP(A2,{Sheet2!B:B,Sheet2!A:A},2,0))
- 这里我们直接在公式中交换查找键的范围和输出的范围
查找字段必须是数据表中的第一列。否则Vlookup将无法工作。这意味着您的 ID 字段必须位于地址之后。