 # Counting values + sorting

I need help with google sheet.
I need to count the values of the same type, starting from the one with the lowest value to the one with the highest value, like the red column.
I can’t do it

Can you elaborate what you want with an exemple? like count the values of which column (same type)

Se ho capito bene cosa vuoi fare, puoi farlo, credo, con la funzione “query” in google sheet.

If I understood correctly what you mean, you could probably do it with “query” function in Google sheet

something like =query(A2:F;“select count(E) group by E Asc”;-1)

have a look

1 Like

Oh yes,
Example:
I enter three values of the same category: A4
the first A4-1 value will be: 4
the second A4-2 value will be: 12
the third value A4-3 will be: 5

I need to create a new column with the numbering from the smallest number to the largest number always starting from 1
The column should look like this:
A4-1: 1
A4-2: 3
A4-3: 2

ok get it you need to rank items of the same category depending on the value. Send me the link of a simple google sheet with your data

Tnxm this is the sheet: Test - Google Sheets

use this
=RANK(C2,filter(A:C,A:A=A2),1) but you will have to copy it doesn’t work with arrayformula

Tnx!
i didn’t know the rank function, i found a script that works in array

``````=ARRAYFORMULA(RANK(ARRAY_CONSTRAIN(VLOOKUP(Lavorazioni!A2:A,{UNIQUE(FILTER(Lavorazioni!A2:A,Lavorazioni!A2:A<>"")),ROW(INDIRECT("a1:a"&COUNTUNIQUE(Lavorazioni!A2:A)))},2,)*1000+Lavorazioni!B2:B,COUNTA(Lavorazioni!A2:A),1),ARRAY_CONSTRAIN(VLOOKUP(Lavorazioni!A2:A,{UNIQUE(FILTER(Lavorazioni!A2:A,Lavorazioni!A2:A<>"")),ROW(INDIRECT("a1:a"&COUNTUNIQUE(Lavorazioni!A2:A)))},2,)*1000+Lavorazioni!B2:B,COUNTA(Lavorazioni!A2:A),1),1) - COUNTIF(Lavorazioni!A2:A,"<"&OFFSET(A2,,,COUNTA(Lavorazioni!A2:A))))
``````
1 Like

Thanks for the tip! I didn’t know either