INDEX + AGGREGATE忽略重复的结果

时间:2019-05-09 04:45:05

标签: excel excel-formula

enter image description here

我想提出一个比较两个数组的公式。其中一个具有针对美国50个州,哥伦比亚特区和波多黎各的ISO代码,在第二个数组中仅具有这些地区中的20个。我希望公式可以忽略两者之间的重复项,而只提取唯一的(或不重复的)代码。到目前为止,我已经能够使用非常长且复杂的公式来做到这一点。我一直在寻找一种简化方法。

=INDEX($B$4:$B$55,AGGREGATE(15,3,($B$4:$B$55<>$C$4)/($B$4:$B$55<>$C$4)*($B$4:$B$55<>$C$5)/($B$4:$B$55<>$C$5)*($B$4:$B$55<>$C$6)/($B$4:$B$55<>$C$6)*($B$4:$B$55<>$C$7)/($B$4:$B$55<>$C$7)*($B$4:$B$55<>$C$8)/($B$4:$B$55<>$C$8)*($B$4:$B$55<>$C$9)/($B$4:$B$55<>$C$9)*($B$4:$B$55<>$C$10)/($B$4:$B$55<>$C$10)*($B$4:$B$55<>$C$11)/($B$4:$B$55<>$C$11)*($B$4:$B$55<>$C$12)/($B$4:$B$55<>$C$12)*($B$4:$B$55<>$C$13)/($B$4:$B$55<>$C$13)*($B$4:$B$55<>$C$14)/($B$4:$B$55<>$C$14)*($B$4:$B$55<>$C$15)/($B$4:$B$55<>$C$15)*($B$4:$B$55<>$C$16)/($B$4:$B$55<>$C$16)*($B$4:$B$55<>$C$17)/($B$4:$B$55<>$C$17)*($B$4:$B$55<>$C$18)/($B$4:$B$55<>$C$18)*($B$4:$B$55<>$C$19)/($B$4:$B$55<>$C$19)*($B$4:$B$55<>$C$20)/($B$4:$B$55<>$C$20)*($B$4:$B$55<>$C$21)/($B$4:$B$55<>$C$21)*($B$4:$B$55<>$C$22)/($B$4:$B$55<>$C$22)*($B$4:$B$55<>$C$23)/($B$4:$B$55<>$C$23)*(ROW($B$4:$B$55)-ROW($B$3)),ROWS($A$4:A4)),)

1 个答案:

答案 0 :(得分:1)

D4中尝试以下公式:

{=INDIRECT(TEXT(MIN(IF(($B$4:$C$55<>"")*(COUNTIF($D$1:D3,$B$4:$C$55)=0),ROW($4:$55)*100+COLUMN($B:$C),7^8)),"R0C00"),)&""}

通过 Ctrl Shift Enter

输入

来源:Here