What formula in LibreOffice Calc will count the number of distinct Week_Number occurrences? The answer should be 2.
A quick way for that is: Click into the Pivot table and press Strg + * (in the numpad). Then set a filter by Data > More Filters > Standard Filter . In field Field name select Count - your label. In field Condition select Largest and in field Value write 100.
The COUNT DISTINCT function returns the number of unique values in the column or expression, as the following example shows. SELECT COUNT (DISTINCT item_num) FROM items; If the COUNT DISTINCT function encounters NULL values, it ignores them unless every value in the specified column is NULL.
To get a count of unique values by each column I will use n_distinct from dplyr. Unique values in one column. If it is necessary to do that for all data frame columns then you can use R base functions sapply or lapply. The output will be in different formats.
This question has been asked many times before. One way is to enter the following formula in B6
and then press Ctrl+Shift+Enter:
=SUM(1/COUNTIF(B2:B5,B2:B5))
Other solutions are described at:
I prefer using a database such as LibreOffice Base instead, with a simple query:
SELECT COUNT(DISTINCT Week_Number) FROM Weeks_Table;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With