How to count the number of text value appearances?

In my source table, I have order numbers (text value, like for example: ZM/00124/02/2024). However, because I also have order items (text value - name of the products) and there can be many order items per order in a row, so order number is repeated in each row if there are more items. Now I have to quickly count how many orders there were in total (regardless of the number of items in them).

So basically, I want the to get the count number of the repeated text values in a cell.

Thank you

If you wish to count cells try COUNTIF:
https://wiki.documentfoundation.org/Documentation/Calc_Functions/COUNTIF

I don’t think it will work, because COUNTIF needs criteria and there is none.

It just must automatically count how many times in a column there was a unique appearance of certain value. How can I specify criteria for “uniqueness”?

Then I would need to show that value per date in a pivot table, but let’s save it for later. So basically, I need how many orders there were per month. This in theory should be a simple task and yet, it feels impossible. Counting manually is not a solution when there are too many orders per month and a lot of order items in each order. It’s easy to do a mistake manually.

I could return the number of orders from different table, but then, how do I do pivot table from different and not compatible sources? The source table I have, have all the data I require, but the order values are repeated multiple times in a row, when there are more order items. So I need to calculate how many orders there were from that.

I found solution for Excel, but since it uses English version of the formula, I cannot find how it is named in LO:

sounds like a db COUNT() GROUP BY

Before the UNIQUE() function appears in Excel, a combination of the FREQUENCY(), MATCH() and ROW() functions was used to solve such problems

=SUMPRODUCT(FREQUENCY(MATCH(data;data;0);ROW(data)-ROW(data_firstcell)+1)>0)

Two ways either look it up or set calc to use english function-names, while testing something you found in english, then switch back, to see your translated version.( Menu “Tools” > “Options”, then “Libre Office Calc” > “Formula” )

And for the second approach:
worksheet function - Switch Calc (or Excel) formulas to English language - Super User.

1 Like