Google表格跨多个工作表的多列的VLOOKUP

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

我不是100%肯定VLOOKUP是用于此的正确公式,但我正在尝试的是以下内容:

=ArrayFormula(IF(len(B2:B),vlookup(B2:B,{‘New1′!B3:C;’New2′!B3:C;’New3’!B3:C},2,FALSE),””))

我想修改上面的公式来执行以下操作。我有一个包含多个标签的Google表格。有一个选项卡,其中所有数据都存储为元数据,以填充其他6个选项卡。我将元数据拆分为6个选项卡,但希望避免重复选项卡中的数据。所以我想创建一个列,它可以显示数据当前放置的位置。这是一个例子:

Master Sheet有这些数据:

Name1, Phone1, Address1, E-mail1 
Name2, Phone2, Address2, E-mail2
Name3, Phone3, Address3, E-mail3 
Name4, Phone4, Address4, E-mail4

将有4个选项卡,我有相同的列(名称,电话,地址,电子邮件)。我将把主表中的数据拆分为这4个选项卡。如果我在选项卡3中放置“Name2,Phone2,Address2,E-mail2”:我希望公式在VLOOKUP中查看整个数据块,而不仅仅是名称,如果是,则显示“Tab 3”场。存在具有相同名称或地址的元数据,因此我希望VLOOKUP查看多个选项卡(选项卡1,选项卡2,选项卡3,选项卡4)并与多个列进行比较以匹配(名称,电话,地址,E-邮件与主表中的邮件完全相同)如果它找到匹配...它将显示它所在的选项卡的某种指示(“选项卡3”)。希望这是有道理的。

google-sheets vlookup google-sheets-formula
1个回答
1
投票
=ARRAYFORMULA(IFERROR(SUBSTITUTE(SPLIT(TRIM(
    TRANSPOSE(QUERY(TRANSPOSE(SUBSTITUTE(IF(LEN(A2:A), {
 IF(TRANSPOSE(QUERY(TRANSPOSE(A2:D),,999^99))=IFERROR(VLOOKUP(
    TRANSPOSE(QUERY(TRANSPOSE(A2:D),,999^99)),
    TRANSPOSE(QUERY(TRANSPOSE(Sheet1!A2:D),,999^99)),1,0)), "Sheet1", ),
 IF(TRANSPOSE(QUERY(TRANSPOSE(A2:D),,999^99))=IFERROR(VLOOKUP(
    TRANSPOSE(QUERY(TRANSPOSE(A2:D),,999^99)),
    TRANSPOSE(QUERY(TRANSPOSE(Sheet2!A2:D),,999^99)),1,0)), "Sheet2", ),
 IF(TRANSPOSE(QUERY(TRANSPOSE(A2:D),,999^99))=IFERROR(VLOOKUP(
    TRANSPOSE(QUERY(TRANSPOSE(A2:D),,999^99)),
    TRANSPOSE(QUERY(TRANSPOSE(Sheet3!A2:D),,999^99)),1,0)), "Sheet3", ),
 IF(TRANSPOSE(QUERY(TRANSPOSE(A2:D),,999^99))=IFERROR(VLOOKUP(
    TRANSPOSE(QUERY(TRANSPOSE(A2:D),,999^99)),
    TRANSPOSE(QUERY(TRANSPOSE(Sheet4!A2:D),,999^99)),1,0)), "Sheet4", )}, ),
 " ", "♦")),,999^99))), " "), "♦", " ")))

0

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