如何从表格中提取单元格以创建新表格?

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

How to pull out cells out of a table to create a new table?

问题

如何从表格中提取出单元格(Names)及其对应的单元格(Ages),以创建一个新的表格?

我有下面的姓名和年龄列:

如何从表格中提取单元格以创建新表格?

我想要提取以下内容:

如何从表格中提取单元格以创建新表格?

这样我的最终列将如下所示,分别是Names_final和Ages_final:

如何从表格中提取单元格以创建新表格?

英文:

How can I pull out cells (Names) and their corresponding cells (Ages) out of a table to create a new one?

I have the column of names and ages below:

如何从表格中提取单元格以创建新表格?

I'd like to pull out the following:

如何从表格中提取单元格以创建新表格?

So that my final column will be as it is below in Names_final and Ages_final

如何从表格中提取单元格以创建新表格?

答案1

得分: 2

使用FILTERCOUNTIFS

=FILTER(A2:B9, COUNTIFS(D2:D4, A2:A9) = 0)
英文:

Using FILTER and COUNTIFS:

=FILTER(A2:B9,COUNTIFS(D2:D4,A2:A9)=0)

如何从表格中提取单元格以创建新表格?

答案2

得分: 2

排除两列中的匹配项

  • 重要的是 FILTER 函数。
  • 使用 COUNTIFS,您可以这样做:
=FILTER(A2:B12,COUNTIFS(D2:D4,A2:A12,E2:E4,B2:B12)=0,"") 
  • 使用双重 XMATCH,您可以这样做:
=FILTER(A2:B12,NOT(ISNUMBER(XMATCH(A2:A12,D2:D4)*XMATCH(B2:B12,E2:E4))),"") 

如何从表格中提取单元格以创建新表格?

  • 要使其对 COUNTIFS 版本更灵活,您可以这样做:
=LET(md,A2:B12,mnc,1,mac,2,ed,D2:E4,enc,1,eac,2,
    mn,INDEX(md,,mnc),ma,INDEX(md,,mac),
    en,INDEX(ed,,enc),ea,INDEX(ed,,eac),
    f,COUNTIFS(en,mn,ea,ma)=0,
FILTER(md,f,""))

使用以下变量命名逻辑:

m - 匹配
e - 排除
d - 数据
n - 名称
a - 年龄
c - 列
f - 过滤  
  • 对于 XMATCH 版本,只需不同的过滤器:
    f,NOT(ISNUMBER(XMATCH(mn,en)*XMATCH(ma,ea))), 
英文:

Exclude Matches in Two Columns

  • The star of the show is the FILTER function.

  • Using COUNTIFS, you could do:

=FILTER(A2:B12,COUNTIFS(D2:D4,A2:A12,E2:E4,B2:B12)=0,"")
  • Using a double XMATCH, you could do:
=FILTER(A2:B12,NOT(ISNUMBER(XMATCH(A2:A12,D2:D4)*XMATCH(B2:B12,E2:E4))),"")

如何从表格中提取单元格以创建新表格?

  • To make it more flexible for the COUNTIFS version, you could do:
=LET(md,A2:B12,mnc,1,mac,2,ed,D2:E4,enc,1,eac,2,
    mn,INDEX(md,,mnc),ma,INDEX(md,,mac),
    en,INDEX(ed,,enc),ea,INDEX(ed,,eac),
    f,COUNTIFS(en,mn,ea,ma)=0,
FILTER(md,f,""))

with the following variable naming logic:

m - match
e - exclusion
d - data
n - name
a - age
c - column
f - filter  
  • The same for the XMATCH version requires only a different filter:
    f,NOT(ISNUMBER(XMATCH(mn,en)*XMATCH(ma,ea))),

huangapple
  • 本文由 发表于 2023年6月5日 23:26:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76407909.html
匿名

发表评论

匿名网友

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

确定