LibreOffice Calc count the number of distinct occurrences

后端 未结 2 938
北荒
北荒 2021-02-15 14:25

What formula in LibreOffice Calc will count the number of distinct Week_Number occurrences? The answer should be 2.

2条回答
  •  天命终不由人
    2021-02-15 14:49

    I tried using =SUM(1/COUNTIF(A:A,A:A)) on a column with 2500 rows, and got a divide by zero error for my trouble, (After hours of computation time.). Then I thought of:

    =SUMPRODUCT( A$3:A1000000<>OFFSET(A$3:A1000000,-1,0)) which works to find the number of distinct values in SORTED column A2... by finding when the value in cell Ax is different than the value in the cell directly above it (OFFSET(...,-1,0)).

    Now if we only had a SORT array function this problem would be solved.

提交回复
热议问题