Home > OS >  Count Distinct Values in the entire sheets
Count Distinct Values in the entire sheets

Time:11-17

May I know any ways can provide the required result? I tried using pivot table, but found some wordings cannot be showed.

DATA

Col1 Col2 Col3 Col4 .... Col20
coffee tea bread n/a ... n/a
bread ice cream n/a n/a ... n/a
mango juice bread coke wine ... ice cream
coke cake ice cream n/a ... n/a
wine bread coke n/a ... n/a
{below about 150,000 records} ... ... ... ... ...

RESULT

ItemName Qty
bread 40000
coffee 90000
coke 5000
.... ....
.... ....
.... ....
.... ....
wine 2000

CodePudding user response:

If you have Excel-365 then you may try below formulas.

G2=SORT(UNIQUE(FILTERXML("<t><s>"&TEXTJOIN("</s><s>",TRUE,A2:E6)&"</s></t>","//s")))

H2=COUNTIF(A2:E6,G2#)

enter image description here

CodePudding user response:

Try This:

Insert a Pivot table and select the option "Add this data to the Data Model"

enter image description here

and then from "Value Field Settings" for the column in the Values area select "Distinct Count"

enter image description here

CodePudding user response:

To get unique list you can use:

=LET(data,$A$2:$E$10000, 
     rows, A1:INDEX(A:A,COUNTA(data),0),
     SORT(
      UNIQUE(
        INDEX(data,
              1 INT((ROW(rows)-1)/COLUMNS(data)),
              MOD(ROW(rows)-1 COLUMNS(data),
              COLUMNS(data)) 1)
       )
     )
   )

and to get count:

=COUNTIF(A2:E10000,H2#)

enter image description here

  • Related