Excel – 如何从不同列中使用vlookup查找数据

huangapple go评论105阅读模式
英文:

Excel - How to vlookup data from various columns

问题

现在,为了找到答案(我想知道数据中是否有1和4),我需要手动合并列1和列2的数据,并创建一个新的列。

如何从不同的列中使用vlookup()来查找答案?不需要手动合并数据吗?数据中有数百列,每一列都包含成千上万的数据。

英文:

Right now , in order to find the answer (I want to know if there is 1 and 4 in the data)

I need to manually combine the data from Column 1 and Column 2 and create a new Column

How to vlookup() the answer from various columns? not need to manually combine the data? There are hundreds of columns in the data, and each column contains thousands of data

Excel – 如何从不同列中使用vlookup查找数据

答案1

得分: 2

根据评论,COUNTIFS() 可能适合您。请尝试 -

=IF(COUNTIFS(C3:D5,A3)>0,"是","否")
英文:

As per comment, COUNTIFS() may work for you. Try-

=IF(COUNTIFS(C3:D5,A3)>0,"Yes","No")

答案2

得分: 2

匹配2个数值

溢出

=LET(Data,C2:M21,Value1,1,Value2,4,y,"是",n,"否",
    br,BYROW(Data,LAMBDA(r,
        ISNUMBER(XMATCH(Value1,r)*XMATCH(Value2,r)))),
IF(br,y,n))

Excel – 如何从不同列中使用vlookup查找数据

对于单行

真/假

=ISNUMBER(MATCH(1,C2:M2,0)*(MATCH(4,C2:M2,0)))

是/否

=IF(ISNUMBER(MATCH(1,C2:M2,0)*MATCH(4,C2:M2,0)),"是","否")

编辑:更灵活

  • 您可以使用 TOCOL 将值写入值列(v),排除空单元格和包含错误值的单元格。然后,您可以将每行的数字匹配数(COUNT())与值列(v)的行数(c)进行比较。
  • 现在 Values 参数变得非常灵活。
=LET(Data,C2:M21,Values,O2:P11,y,"是",n,"否",
    v,TOCOL(Values,3),c,ROWS(v),
    br,BYROW(Data,LAMBDA(r,
        COUNT(XMATCH(v,r))=c)),
IF(br,y,n))

Excel – 如何从不同列中使用vlookup查找数据

英文:

Match 2 Values

Spilling

=LET(Data,C2:M21,Value1,1,Value2,4,y,"Yes",n,"No",
    br,BYROW(Data,LAMBDA(r,
        ISNUMBER(XMATCH(Value1,r)*XMATCH(Value2,r)))),
IF(br,y,n))

Excel – 如何从不同列中使用vlookup查找数据

For a Single Row

TRUE/FALSE

=ISNUMBER(MATCH(1,C2:M2,0)*(MATCH(4,C2:M2,0)))

Yes/No

=IF(ISNUMBER(MATCH(1,C2:M2,0)*MATCH(4,C2:M2,0)),"Yes","No")

EDIT: More Flexibility

  • You can use TOCOL to write the values to the Value column (v) excluding empty cells and cells containing error values. Then you can compare the number of numeric matches per row (COUNT()) with the number of rows (c) of the Value column.
  • Now the Values argument has become very flexible.
=LET(Data,C2:M21,Values,O2:P11,y,"Yes",n,"No",
    v,TOCOL(Values,3),c,ROWS(v),
    br,BYROW(Data,LAMBDA(r,
        COUNT(XMATCH(v,r))=c)),
IF(br,y,n))

Excel – 如何从不同列中使用vlookup查找数据

huangapple
  • 本文由 发表于 2023年6月16日 11:29:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/76486797.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定