简体   繁体   English

Excel 搜索值列表,仅返回水平格式的唯一值

[英]Excel Search list of values, and return only unique values in horizontal format

I need to generate a non-duplicated list of item numbers based on values in a range.我需要根据一个范围内的值生成一个不重复的项目编号列表。

Two possible options:两种可能的选择:

Formula: Trying to search a range and return a corresponding value from another column.公式:尝试搜索一个范围并从另一列返回相应的值。 I am searching with a range of values, and need a list of only the unique items to generate.我正在搜索一系列值,并且需要一个仅包含要生成的唯一项目的列表。

Pivot Table: Pivot 表:

Filter a pivot table based off a range of cells I can paste into.根据我可以粘贴到的一系列单元格过滤 pivot 表。 I have tried multiple options and haven't been able to get it to work.我尝试了多种选择,但无法让它发挥作用。

按范围排序

On another sheet (BOM Sorting Sheet) search for "To Be Disc'd" values in Column A and return all values found from Column H (unique only).在另一张表(BOM 排序表)上,在 A 列中搜索“待盘”值,并返回从 H 列找到的所有值(仅唯一)。

Goal: Be able to copy and paste values from email to "To Be Dis'd" and a unique item list will generate automatically.目标:能够将值从 email 复制并粘贴到“To Be Dis'd”,并且将自动生成唯一的项目列表。

在 A 列中输入要过滤的数字。工作表名称为“Discontinued STK's”

All help appreciated:)所有帮助表示赞赏:)

I also tried...我也试过...

Various formulas that I couldn't get to work, I am positive it is a user error, just not sure what I'm missing.我无法使用的各种公式,我很肯定这是一个用户错误,只是不确定我错过了什么。

=Transpose(vlookup =转置(vlookup

=UNIQUE(FILTER(data,(range1="b")*(range2>5))) =唯一(过滤器(数据,(范围1 =“b”)*(范围2> 5)))

{=INDEX(range1,MATCH(1,(A1=range2) (B1=range3) (C1=range4),0))} {=INDEX(range1,MATCH(1,(A1=range2) (B1=range3) (C1=range4),0))}

'Private Sub Worksheet_SelectionChange(ByVal Target As Range)
 ' If Not Intersect(Target, Range("A15:A16")) Is Nothing Then
  'End If
 ' Dim vArray As Variant
 ' Dim b As Integer, c As Integer
 ' Dim pvFld As PivotField
 ' Set pvFld = ActiveSheet.PivotTables("PivotTable1").PivotFields("*Item")
 ' vArray = Range("A15:A16")
 ' pvFld.ClearAllFilters

'  With pvFld
 '   For i = 1 To pvFld.PivotItems.Count
  '    j = 1
   '    Do While j <= UBound(vArray, 1) - LBound(vArray, 1) + 1
    '     If pvFld.PivotItems(i).Name = vArray(a, 1) Then
     '      pvFld.PivotItems(pvFld.PivotItems(i).Name).Visible = True
      '     Exit Do
       ' Else
        '  pvFld.PivotItems(pvFld.PivotItems(i).Name).Visible = False
  '      End If
   '     j = j + 1
    '  Loop
 '   Next i
 ' End With
'End Sub

从拉

在这里列出

Goal: Entry point and Unique list of items based on a list of STK's copied from email.目标:基于从 email 复制的 STK 列表的入口点和唯一项目列表。

If you would like to sort a Pivot Table automatically and get a list of data that is unique (not duplicated), this is the combination I used.如果您想自动对 Pivot 表进行排序并获取唯一(不重复)的数据列表,这就是我使用的组合。

To sort a Pivot Table section based on a cell range NOT in your data source.根据不在数据源中的单元格范围对 Pivot 表部分进行排序。

Step 1步骤1

Add 2 columns to your source data for your Pivot Table.将 2 列添加到 Pivot 表的源数据中。

Column 1, reference the data entry cells (I added an entry point on the sheet that contained my Tracker for Disc'd items for easier sorting).第 1 列,引用数据输入单元格(我在包含我的 Tracker for Disc'd 项目的工作表上添加了一个入口点,以便于排序)。

Column 2, add an ifs formula that references the data in column 1 and the data you want to auto filter give you a column with the data you need from the entry point only (A set number of cells that you can enter data into will simplify the Ifs function considerably, and you will not need to edit later).第 2 列,添加一个引用第 1 列中数据的 ifs 公式,并且您要自动过滤的数据为您提供一列,其中包含您需要的数据,仅来自入口点(您可以输入数据的一组单元格将简化Ifs function 相当大,您以后不需要编辑)。

Now you have a column that after refreshing the Pivot Table will automatically show the new list of data based on the Entry Range.现在您有一个列,在刷新 Pivot 表后,将根据输入范围自动显示新的数据列表。

Set the filter on that column to automatically ignore errors, zeros, & blanks.将该列上的过滤器设置为自动忽略错误、零和空白。

Step 2第2步

Enter the formula (=UNIQUE($F:$F) in a column next to the pivot table. Change the column to reflect the unique data list wanted.在 pivot 表旁边的列中输入公式 (=UNIQUE($F:$F)。更改列以反映所需的唯一数据列表。

Step 3第 3 步

Add a refresh button on the tracker sheet (or notes sheet).在跟踪表(或注释表)上添加刷新按钮。 You can use a VBA Code to refresh the Pivot Table.您可以使用 VBA 代码来刷新 Pivot 表。

Sheet1.PivotTables("PivotTable1").Refreshtable

Step 4第4步

Use a column to reference the Unique items pulled in the Pivot table.使用列来引用 Pivot 表中提取的唯一项。

Now you have everything needed on one sheet to enter, search and quickly take action on items.现在,您可以在一张纸上输入、搜索和快速对项目采取行动所需的一切。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM