Hi, and welcome to the forum.
Incompetente wrote:I m searching a function …
People frequently make tasks harder by trying to do everything with functions instead of using
features like Data Pilot, filtering, Text to Columns, Multiple Operations, Subtotals, etc. Calc is more than just functions.
Incompetente wrote:I would do like to count the number of "R" (or D or L) with unique values of the first column. In this case shoud be R=4, D=2, L=1
I've added a column First which uses a SUMPRODUCT formula to locate the first occurrence of each Number:Letter combination. Then a pivot table with Letter in Row Fields and First in Data Fields immediately provides the requested information.

- Pivot table
Incompetente wrote:And If I change my data, will this table update?
No, but often all one needs to do is right-click the pivot table and select Refresh.
FJCC has more complete instructions. Of course, you should read the documentation if you want to better understand pivot tables.
Using the DataPilot Pivot tables
FJCC wrote:… count the values greater than zero in the table …
I think what I've done with my
First column is equivalent to your approach, but I do the calculation before creating the pivot table and you do yours afterward.
Lupp wrote:SUMPRODUCT() is a badly named function.
I too wish it were named differently. The function is so useful that it should have a shorter name, say SP(). The tutorial below shows over two dozen ways it can be used.
Lupp wrote:This trick I first found presented in this forum years ago. I suppose it was posted by MrProgrammer then.
I learned the technique from others, perhaps 25 years ago. I use it sometimes, though I prefer FREQUENCY now.
[Tutorial] The SUMPRODUCT function
If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the subject field. Select the green checkmark icon at the same time.
[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.5, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).