使用不同的ID号进行唯一值过滤。

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

Filtering for Unique Values with different ID Numbers

问题

我一直在尝试从一个标签筛选出唯一值到另一个标签。然而,在两个标签中,我都有一个ID列。我基本上想将唯一的值与它们各自的ID编号对齐,然后使用筛选视图来隐藏空白。

任何帮助将不胜感激。
谢谢

我使用了这个公式:

={"PO#", "MP#";ARRAYFORMULA(IFERROR(VLOOKUP(A4:A,'SHEET1'!A5:H,{7,8},0))}

然后得到了这个:

={"PO#", "MP#";ARRAYFORMULA(IFERROR(VLOOKUP(A4:A,FILTER('SHEET1'!A5:H,UNIQUE('SHEET1'!G5:G)),{7,8},0))}

第二个标签中的PO#和MP#是具有重复项的值,并将从SHEET1的列G和H中导入。两个标签的ID列在列A中(它们只是从不同位置开始)。

我期望具有重复的PO#和MP#的行为空,直到下一个唯一行。
我还链接了一个Google表格在此处来说明我的问题。

谢谢

英文:

I have been trying to filter for unique values from one tab to another. However in both tabs, I have an ID Column. I basically want to align the Unique values to their respective ID Number, then use the filter view to hide the blanks.

Any help will be appreciated.
Thanks

I used this formula:

={"PO#","MP#";ARRAYFORMULA(IFERROR(VLOOKUP(A4:A,'SHEET1'!A5:H,{7,8},0)))}

and came up with this:

​={"PO#","MP#";ARRAYFORMULA(IFERROR(VLOOKUP(A4:A,FILTER('SHEET1'!A5:H,UNIQUE('SHEET1'!G5:G)),{7,8},0)))}​

PO# and MP# in the second tab are the values with duplicates and will be imported from SHEET1's Column G and H respectively. Both tab's ID Column are in Column A (They just start in different positions).

I expected the rows with duplicated PO# and MP# to be blank, until the next unique row.
I have also linked a Google Sheets here to illustrate my problem.

Thanks

答案1

得分: 0

以下是翻译好的内容:

一种方法是使用 vlookup()unique(),如下所示:

={ Sheet1!A1:A }
=arrayformula(
  iferror(
    vlookup(
      A1:A,
      vlookup(
        unique(Sheet1!B1:B),
        { Sheet1!B1:B, Sheet1!A1:C },
        sequence(1, columns(Sheet1!A1:C), 2),
        false
      ),
      { 2, 3 },
      false
    )
  )
)

请查看 解决方案 选项卡。

英文:

One way is to use vlookup() and unique(), like this:

={ Sheet1!A1:A }
=arrayformula( 
  iferror( 
    vlookup( 
      A1:A, 
      vlookup( 
        unique(Sheet1!B1:B), 
        { Sheet1!B1:B, Sheet1!A1:C }, 
        sequence(1, columns(Sheet1!A1:C), 2), 
        false 
      ), 
      { 2, 3 }, 
      false 
    ) 
  ) 
)

See the Solution tab.

答案2

得分: 0

已添加公式到您的表格:

=BYROW(A2:A, LAMBDA(z, IF(z="", , INDEX(IFNA(VLOOKUP(z, FILTER({Sheet1!A:C}, BYROW(Sheet1!B:B, LAMBDA(Σ, COUNTIF(Sheet1!B1:Σ, Σ)))=1), {2,3}, )))))

使用不同的ID号进行唯一值过滤。

英文:

Added formula to your sheet:

=BYROW(A2:A,LAMBDA(z,IF(z="",,INDEX(IFNA(VLOOKUP(z,FILTER({Sheet1!A:C},BYROW(Sheet1!B:B,LAMBDA(Σ,COUNTIF(Sheet1!B1:Σ,Σ)))=1),{2,3},))))))

使用不同的ID号进行唯一值过滤。

huangapple
  • 本文由 发表于 2023年2月8日 15:34:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/75382585.html
匿名

发表评论

匿名网友

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

确定