Search code examples
google-sheetsgoogle-sheets-formula

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


Solution

  • 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: