指数&匹配公式不会显示具有不同值的重复条目

时间:2015-05-12 11:20:05

标签: excel excel-formula excel-match

我有一个excel spreadsheet - downloadable here包含以下几列:

Column A : Companies' Names
Column B : Project's Name 

当我尝试使用组合框过滤我的数据时,只显示特定区域的公司,并使用INDEXMATCH在搜索结果中显示同一行中包含公司名称的所有相关数据,因为我有一些公司不仅仅是项目,不太可能INDEXMATCH只重复公司名称的第一行,如下所示:

Company1    Project 1
Company1    Project 1

虽然公司1有两个项目1和2,但必须如下

Company1   Project1
Company1   Project2

但公式只是重复它找到的第一行。

图1 - 搜索结果不正确

enter image description here

图2 - 我想在搜索结果中显示的主要数据

enter image description here

2 个答案:

答案 0 :(得分:1)

正如@houssam所述,你可以在 S3 中尝试这个:

 =IFERROR(INDEX($C$3:$C$22,$N3,COLUMNS($R$3:R3)),"")

这有帮助吗?

答案 1 :(得分:1)

You are using the Company Name to match while it is not unique. 1,1970360,57484768/0001-03,204,Bossa Nossa,Solo,6212-G,2,M,27/04/2015,21/06/2015,26/2015,15,5142,1970356,AMOSTRA, ,27/04/2015 1,1970361,57484768/0001-03,204,Bossa Nossa,Solo,6212-G,2,M,27/04/2015,21/06/2015,26/2015,15,5142,1970357,AMOSTRA, ,27/04/2015 1,1971182,57484768/0001-03,204,Bossa Nossa,Solo,6212-G,2,M,28/04/2015,21/06/2015,26/2015,15,5142,1970358,AMOSTRA, ,28/04/2015 1,1971188,57484768/0001-03,204,Bossa Nossa,Solo,6212-G,2,M,28/04/2015,21/06/2015,26/2015,15,5142,1970355,AMOSTRA, ,28/04/2015 always returns the first occurrence index it finds.

You can use the same formula you used to find the company name for the other columns, and that will ensure you get the same row data. Just copy the cell from Company Name to the other columns, so the formula in MATCH will be:

S3

R3 changes to S3, and this will return the Amount column, as INDEX($B$3:$K$32,$N3,COLUMNS($R$3:S3) returns 2.