Array formula to return an ARRAY without duplicates, without VBA

后端 未结 3 1877
野性不改
野性不改 2021-02-06 20:04

I would like to know whether it\'s possible to return an array from a single cell formula, which is filtered to remove duplicates, and which is built purely on Excel formulas.

3条回答
  •  梦如初夏
    2021-02-06 20:13

    This formula will return a sorted array without duplicates, e.g. for your example

    {0.1;0.2;0.3;0.7}

    =SMALL(IF(MATCH(A1:A5,A1:A5,0)=ROW(A1:A5)-ROW(A1)+1,A1:A5),ROW(INDIRECT("1:"&SUM(0+(0<(FREQUENCY(A1:A5,A1:A5)))))))

    confirmed with CTRL+SHIFT+ENTER

    ......or this version will keep the order

    =INDEX(A1:A5,N(IF({1},SMALL(IF(MATCH(A1:A5,A1:A5,0)=ROW(A1:A5)-ROW(A1)+1,ROW(A1:A5)-ROW(A1)+1),ROW(INDIRECT("1:"&SUM(0+(0<(FREQUENCY(A1:A5,A1:A5))))))))))

提交回复
热议问题