ichark
ichark

Reputation: 15

Google Sheets Count Unique Values

I need your help with a formula in google sheets.

I have a table of income data. My goal is get all unique vales of pdoctuct name and count of all its values.

E.x. "Product 1" is in two places with "count" 3 and 1. So the result is "Product 1 - 4".

I need formula with help me calculate it automaticaly.

Thank you for your help!

enter image description here

Upvotes: -5

Views: 87

Answers (2)

Jats PPG
Jats PPG

Reputation: 790

Use UNIQUE and SUMIF

=LET(a, UNIQUE(TOCOL(Sheet1!A2:A)),
 SORT(HSTACK(a, BYROW(a, LAMBDA(x, SORT(SUMIF(Sheet1!A2:C, x, Sheet1!C2:C))))), 2, FALSE))

Sample Output:

Name Count
balance-veselka-10mm 114
Veselka-8 81
balance-veselka-12mm 44
Veselka-8х6 35

References:

Upvotes: 2

rockinfreakshow
rockinfreakshow

Reputation: 30240

You may try:

=query(A2:B,"Select A,sum(B) where A!='' group by A order by sum(B) desc",1)

Upvotes: 2

Related Questions