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#)
CodePudding user response:
Try This:
Insert a Pivot table and select the option "Add this data to the Data Model"
and then from "Value Field Settings" for the column in the Values area select "Distinct Count"
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#)