https://bugs.documentfoundation.org/show_bug.cgi?id=169323

            Bug ID: 169323
           Summary: Provide a cell function to count the number of
                    distinct/unique values in a cell range
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

Description:
I need a fast function to count the number of distinct/unique values in a cell
range. For my 50.000 rows, the solution
`=SUMPRODUCT(1/(COUNTIF(A1:A50000,A1:A50000)))` from
https://stackoverflow.com/a/79812470/1389680 is too slow, taking about 40
seconds to compute.

Steps to Reproduce:
1. create a column with 50000 random integers from 1 to 10.
2. Count the number of different values in this row, by defining a cell with
`=SUMPRODUCT(1/(COUNTIF(A1:A50000,A1:A50000)))`.


Actual Results:
It takes 40 seconds (of UI freeze) until the value 10 appears.

Expected Results:
The cell should immediately evaluate to 10.


Reproducible: Always


User Profile Reset: No

Additional Info:
Observed on:
Version: 24.2.7.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 32; OS: Linux 6.14; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 4:24.2.7-0ubuntu0.24.04.4
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to