求多列数据重复值
如图四列数据 (门店卖水果)
需要统计,四家门店同时卖的水果,三家同时卖和两家同时卖的需要怎么弄公式?
请教各位大神
G2,数组公式,右拉下拉。
=INDIRECT(TEXT(MIN(IF((COUNTIF(G$1:G1,$B$2:$E$8)=0)*(COUNTIF($B:$E,$B$2:$E$8)=5-COLUMN(A1)),ROW($2:$8)*100+COLUMN($B:$E),1099)),"r0c00"),)&"" =IFERROR(INDIRECT(TEXT(MIN(IF((COUNTIF($B$2:$E$8,$B$2:$E$8)=5-COLUMN(A1))*($B$2:$E$8<>"")*(COUNTIF(I$1:I1,$B$2:$E$8)=0),ROW($2:$8)/1%+COLUMN($B:$E))),"r0c00"),),"") =INDIRECT(TEXT(MIN(IF((COUNTIF(G$1:G1,$B$2:$E$8)=0)*(COUNTIF($B$2:$E$8,$B$2:$E$8)=5-COLUMN(A1))*($B$2:$E$8<>""),ROW($2:$8)*100+COLUMN($B$2:$E$8),1020)),"r0c00"),)&""
数组公式 =INDIRECT(TEXT(MIN(IF(COUNTIF(G$1:G1,IF(COUNTIF($B$2:$E$8,$B$2:$E$8)=COLUMNS(A:$D),$B$2:$E$8,"*")),999,ROW($2:$8)/1%+COLUMN($B:$E))),"R0C00"),)&"" 大佬。看的不是很懂,可以讲解一下思路吗? 选ALT+D P多重合并功能,然后公式也好,筛选也好,都是比较香的。=LOOKUP(ROW(A1)-1,COUNTIF(OFFSET($F$12,,,ROW($1:$20)),4-COLUMN(A1)),$E$13:$E$23)&""
COUNTIF(G$1:G1,$B$2:$E$8)=0,这个是去重功能,
COUNTIF($B:$E,$B$2:$E$8)=5-COLUMN(A1),这处是条件符合性(4个,3个,...)
IF((COUNTIF(G$1:G1,$B$2:$E$8)=0)*(COUNTIF($B:$E,$B$2:$E$8)=5-COLUMN(A1)),ROW($2:$8)*100+COLUMN($B:$E),1099),符合以上两点,返回对应行号*100+列号,否则返回1099(这个值可以自行调整为一个其它合适的值)。
MIN(IF((COUNTIF(G$1:G1,$B$2:$E$8)=0)*(COUNTIF($B:$E,$B$2:$E$8)=5-COLUMN(A1)),ROW($2:$8)*100+COLUMN($B:$E),1099)),取最小值。
TEXT(MIN(IF((COUNTIF(G$1:G1,$B$2:$E$8)=0)*(COUNTIF($B:$E,$B$2:$E$8)=5-COLUMN(A1)),ROW($2:$8)*100+COLUMN($B:$E),1099)),"r0c00"),返回最小值的格式r0c0,即一个r1c1格式的单元格地址。
=INDIRECT(TEXT(MIN(IF((COUNTIF(G$1:G1,$B$2:$E$8)=0)*(COUNTIF($B:$E,$B$2:$E$8)=5-COLUMN(A1)),ROW($2:$8)*100+COLUMN($B:$E),1099)),"r0c00"),)&"",引用单元格的内容。
数据透视表做的,如图:
PQ也可以考虑一下