Spreadsheet: 114625d1310388387-need-pivot-table-to-count-unique-values-dynamically-sample-data
Sheet: Desired output

 | ProdHier | (All)
 | Row Labels | Sum of PS Count | Count of Product Structure | Need
 | Cuautitlán | 749 | 749
 | # | 5 | 5 | 1
 | KMD0000003 | 3 | 3 | 1
 | KMD0000005 | 8 | 8 | 1
 | KMD0000008 | 8 | 8 | 1
 | KMD0000009 | 2 | 2 | 1
 | [NAME] | 1 | 1 | 1
 | KMD0000011 | 3 | 3 | 1
 | [NAME] | 13 | 13 | 1
 | KMD0000017 | 1 | 1 | 1
 | KMD0000019 | 5 | 5 | 1
 | KMD0000021 | 8 | 8 | 1
 | KMD0000027 | 16 | 16 | 1
 | KMD0000030 | 2 | 2 | 1
 | KMD0000031 | 9 | 9 | 1
 | KMD0000034 | 4 | 4 | 1
 | KMD0000036 | 7 | 7 | 1
 | KMD0000039 | 4 | 4 | 1
 | KMD0000041 | 3 | 3 | 1
 | [NAME] | 3 | 3 | 1
 | KMD0000048 | 8 | 8 | 1
 | KMD0000049 | 4 | 4 | 1
 | KMD0000051 | 4 | 4 | 1
 | KMD0000052 | 1 | 1 | 1
 | KMD0000054 | 3 | 3 | 1
 | [NAME] | 4 | 4 | 1
 | KMD0000059 | 3 | 3 | 1
 | KMD0000061 | 5 | 5 | 1
 | KMD0000062 | 7 | 7 | 1
 | KMD0000063 | 2 | 2 | 1
 | KMD0000064 | 17 | 17 | 1
 | KMD0000067 | 5 | 5 | 1
 | KMD0000069 | 2 | 2 | 1
 | [NAME] | 6 | 6 | 1
 | KMD0000072 | 6 | 6 | 1
 | KMD0000073 | 4 | 4 | 1
 | [NAME] | 1 | 1 | 1
 | KMD0000075 | 7 | 7 | 1
 | KMD0000078 | 4 | 4 | 1
 | [NAME] | 10 | 10 | 1
 | KMD0000085 | 20 | 20 | 1
 | KMD0000086 | 2 | 2 | 1
 | KMD0000087 | 1 | 1 | 1
 | [NAME] | 1 | 1 | 1
 | KMD0000089 | 9 | 9 | 1
 | KMD0000090 | 2 | 2 | 1
 | KMD0000092 | 2 | 2 | 1
 | KMD0000095 | 5 | 5 | 1
 | [NAME] | 2 | 2 | 1
 | KMD0000101 | 2 | 2 | 1
 | KMD0000115 | 2 | 2 | 1
 | KMD0000116 | 1 | 1 | 1
 | KMD0000118 | 5 | 5 | 1
 | KMD0000121 | 2 | 2 | 1
 | [NAME] | 2 | 2 | 1
 | KMD0000124 | 2 | 2 | 1
 | [NAME] | 4 | 4 | 1
 | [NAME] | 2 | 2 | 1
 | [NAME] | 3 | 3 | 1
 | [NAME] | 12 | 12 | 1
 | KMD0000161 | 1 | 1 | 1
 | [NAME] | 10 | 10 | 1
 | KMD0000165 | 24 | 24 | 1
 | [NAME] | 1 | 1 | 1
 | [NAME] | 1 | 1 | 1
 | KMD0000178 | 10 | 10 | 1
 | KMD0000179 | 6 | 6 | 1
 | [NAME] | 6 | 6 | 1
 | KMD0000183 | 9 | 9 | 1
 | KMD0000186 | 9 | 9 | 1
 | [NAME] | 5 | 5 | 1
 | [NAME] | 13 | 13 | 1
 | KMD0000192 | 5 | 5 | 1
 | KMD0000194 | 15 | 15 | 1
 | KMD0000202 | 5 | 5 | 1
 | KMD0000203 | 4 | 4 | 1
 | [NAME] | 3 | 3 | 1
 | KMD0000207 | 2 | 2 | 1
 | KMD0000209 | 1 | 1 | 1
 | KMD0000212 | 5 | 5 | 1
 | KMD0000213 | 6 | 6 | 1
 | KMD0000215 | 5 | 5 | 1
 | KMD0000235 | 31 | 31 | 1
 | KMD0000256 | 1 | 1 | 1
 | KMD0000258 | 2 | 2 | 1
 | KMD0000263 | 1 | 1 | 1
 | KMD0000264 | 1 | 1 | 1
 | KMD0000270 | 6 | 6 | 1
 | KMD0000273 | 1 | 1 | 1
 | KMD0000275 | 13 | 13 | 1
 | [NAME] | 6 | 6 | 1
 | KMD0000281 | 2 | 2 | 1
 | KMD0000285 | 12 | 12 | 1
 | KMD0000289 | 4 | 4 | 1
 | KMD0000292 | 11 | 11 | 1
 | KMD0000298 | 18 | 18 | 1
 | KMD0000302 | 4 | 4 | 1
 | KMD0000308 | 23 | 23 | 1
 | [NAME] | 9 | 9 | 1
 | KMD0000316 | 6 | 6 | 1
 | KMD0000338 | 1 | 1 | 1
 | KMD0000339 | 1 | 1 | 1
 | KMD0000347 | 2 | 2 | 1
 | [NAME] | 5 | 5 | 1
 | KMD0000359 | 2 | 2 | 1
 | KMD0000361 | 1 | 1 | 1
 | KMD0000364 | 1 | 1 | 1
 | KMD0000367 | 3 | 3 | 1
 | KMD0000369 | 2 | 2 | 1
 | KMD0000370 | 1 | 1 | 1
 | KMD0000373 | 17 | 17 | 1
 | [NAME] | 6 | 6 | 1
 | KMD0000379 | 2 | 2 | 1
 | KMD0000383 | 1 | 1 | 1
 | KMD0000384 | 1 | 1 | 1
 | [NAME] | 1 | 1 | 1
 | [NAME] | 2 | 2 | 1
 | KMD0000392 | 2 | 2 | 1
 | KMD0000396 | 5 | 5 | 1
 | KMD0000397 | 4 | 4 | 1
 | KMD0000398 | 3 | 3 | 1
 | KMD0000400 | 2 | 2 | 1
 | [NAME] | 6 | 6 | 1
 | KMD0000404 | 10 | 10 | 1
 | KMD0000406 | 5 | 5 | 1
 | KMD0000408 | 1 | 1 | 1
 | KMD0000423 | 2 | 2 | 1
 | [NAME] | 3 | 3 | 1
 | KMD0000426 | 7 | 7 | 1
 | KMD0000430 | 7 | 7 | 1
 | KMD0000433 | 10 | 10 | 1
 | KMD0000437 | 1 | 1 | 1
 | KMD0000439 | 1 | 1 | 1
 | [NAME] | 2 | 2 | 1
 | KMD0000444 | 6 | 6 | 1
 | KMD0000448 | 2 | 2 | 1
 | [NAME] | 18 | 18 | 1
 | [NAME] | 1 | 1 | 1
 | KMD0000452 | 1 | 1 | 1
 | [NAME] | 4 | 4 | 1
 | KMD0000464 | 2 | 2 | 1
 | KMD0000465 | 1 | 1 | 1
 | [NAME] | 2 | 2 | 1
 | KMD0000471 | 1 | 1 | 1
 | KMD0000472 | 1 | 1 | 1
 | KMD0000476 | 1 | 1 | 1
 | [NAME] | 1 | 1 | 1
 | [NAME] | 1 | 1 | 1
 | KMD0000486 | 1 | 1 | 1
 | Kaukauna | 1200 | 1200
 | # | 140 | 140 | 1
 | KME0000001 | 45 | 45 | 1
 | KME0000002 | 13 | 13 | 1
 | KME0000003 | 5 | 5 | 1
 | KME0000004 | 1 | 1 | 1
 | KME0000005 | 5 | 5 | 1
 | KME0000007 | 1 | 1 | 1
 | KME0000008 | 9 | 9 | 1
 | [NAME] | 20 | 20 | 1
 | KME0000011 | 48 | 48 | 1
 | KME0000013 | 22 | 22 | 1
 | [NAME] | 20 | 20 | 1
 | KME0000015 | 38 | 38 | 1
 | KME0000016 | 2 | 2 | 1
 | KME0000019 | 5 | 5 | 1
 | KME0000020 | 4 | 4 | 1
 | KME0000021 | 28 | 28 | 1
 | KME0000023 | 71 | 71 | 1
 | KME0000026 | 52 | 52 | 1
 | KME0000028 | 12 | 12 | 1
 | KME0000030 | 89 | 89 | 1
 | KME0000033 | 20 | 20 | 1
 | KME0000034 | 5 | 5 | 1
 | KME0000035 | 5 | 5 | 1
 | [NAME] | 3 | 3 | 1
 | KME0000039 | 29 | 29 | 1
 | [NAME] | 15 | 15 | 1
 | KME0000042 | 3 | 3 | 1
 | KME0000045 | 1 | 1 | 1
 | KME0000046 | 1 | 1 | 1
 | KME0000049 | 3 | 3 | 1
 | KME0000050 | 2 | 2 | 1
 | [NAME] | 1 | 1 | 1
 | KME0000052 | 8 | 8 | 1
 | KME0000053 | 11 | 11 | 1
 | [NAME] | 5 | 5 | 1
 | KME0000062 | 2 | 2 | 1
 | [NAME] | 7 | 7 | 1
 | KME0000068 | 11 | 11 | 1
 | KME0000069 | 21 | 21 | 1
 | KME0000070 | 33 | 33 | 1
 | KME0000071 | 8 | 8 | 1
 | [NAME] | 7 | 7 | 1
 | [NAME] | 1 | 1 | 1
 | [NAME] | 1 | 1 | 1
 | [NAME] | 2 | 2 | 1
 | KME0000080 | 7 | 7 | 1
 | [NAME] | 5 | 5 | 1
 | KME0000082 | 9 | 9 | 1
 | KME0000083 | 2 | 2 | 1
 | KME0000086 | 6 | 6 | 1
 | [NAME] | 2 | 2 | 1
 | KME0000088 | 17 | 17 | 1
 | [NAME] | 2 | 2 | 1
 | KME0000091 | 10 | 10 | 1
 | KME0000092 | 28 | 28 | 1
 | KME0000093 | 13 | 13 | 1
 | KME0000095 | 7 | 7 | 1
 | [NAME] | 11 | 11 | 1
 | KME0000100 | 2 | 2 | 1
 | [NAME] | 3 | 3 | 1
 | KME0000102 | 5 | 5 | 1
 | KME0000103 | 4 | 4 | 1
 | KME0000104 | 1 | 1 | 1
 | KME0000105 | 4 | 4 | 1
 | KME0000108 | 29 | 29 | 1
 | [NAME] | 8 | 8 | 1
 | KME0000112 | 5 | 5 | 1
 | KME0000113 | 7 | 7 | 1
 | KME0000114 | 5 | 5 | 1
 | KME0000116 | 7 | 7 | 1
 | [NAME] | 8 | 8 | 1
 | KME0000119 | 2 | 2 | 1
 | [NAME] | 24 | 24 | 1
 | KME0000129 | 1 | 1 | 1
 | [NAME] | 6 | 6 | 1
 | KME0000156 | 1 | 1 | 1
 | [NAME] | 3 | 3 | 1
 | KME0000164 | 8 | 8 | 1
 | [NAME] | 4 | 4 | 1
 | [NAME] | 4 | 4 | 1
 | KME0000175 | 2 | 2 | 1
 | KME0000176 | 1 | 1 | 1
 | KME0000177 | 1 | 1 | 1
 | [NAME] | 1 | 1 | 1
 | [NAME] | 33 | 33 | 1
 | KME0000190 | 6 | 6 | 1
 | KME0000191 | 4 | 4 | 1
 | KME0000192 | 12 | 12 | 1
 | KME0000196 | 6 | 6 | 1
 | [NAME] | 2 | 2 | 1
 | KME0000199 | 7 | 7 | 1
 | KME0000200 | 2 | 2 | 1
 | KME0000204 | 1 | 1 | 1
 | KME0000205 | 4 | 4 | 1
 | KME0000208 | 10 | 10 | 1
 | KME0000216 | 1 | 1 | 1
 | [NAME] | 4 | 4 | 1
 | KME0000221 | 1 | 1 | 1
 | KME0000222 | 1 | 1 | 1
 | KME0000224 | 6 | 6 | 1
 | Perth | 668 | 668
 | KMF000052 | 2 | 2 | 1
 | KMF000057 | 43 | 43 | 1
 | KMF000058 | 5 | 5 | 1
 | KMF000060 | 21 | 21 | 1
 | KMF000062 | 10 | 10 | 1
 | [NAME] | 7 | 7 | 1
 | KMF000064 | 22 | 22 | 1
 | [NAME] | 9 | 9 | 1
 | KMF000068 | 21 | 21 | 1
 | KMF000069 | 13 | 13 | 1
 | KMF000070 | 6 | 6 | 1
 | KMF000073 | 4 | 4 | 1
 | KMF000083 | 16 | 16 | 1
 | KMF000084 | 3 | 3 | 1
 | KMF000085 | 8 | 8 | 1
 | KMF000087 | 28 | 28 | 1
 | KMF000088 | 2 | 2 | 1
 | [NAME] | 2 | 2 | 1
 | [NAME] | 11 | 11 | 1
 | KMF000111 | 7 | 7 | 1
 | KMF000112 | 2 | 2 | 1
 | KMF000113 | 1 | 1 | 1
 | [NAME] | 2 | 2 | 1
 | KMF000115 | 2 | 2 | 1
 | KMF000116 | 1 | 1 | 1
 | KMF000117 | 2 | 2 | 1
 | [NAME] | 4 | 4 | 1
 | [NAME] | 5 | 5 | 1
 | KMF000120 | 1 | 1 | 1
 | KMF000121 | 11 | 11 | 1
 | [NAME] | 10 | 10 | 1
 | KMF000123 | 5 | 5 | 1
 | KMF000124 | 6 | 6 | 1
 | KMF000125 | 8 | 8 | 1
 | KMF000126 | 6 | 6 | 1
 | [NAME] | 4 | 4 | 1
 | KMF000128 | 1 | 1 | 1
 | KMF000131 | 7 | 7 | 1
 | KMF000133 | 4 | 4 | 1
 | [NAME] | 2 | 2 | 1
 | KMF000136 | 2 | 2 | 1
 | KMF000137 | 1 | 1 | 1
 | [NAME] | 2 | 2 | 1
 | KMF000141 | 3 | 3 | 1
 | [NAME] | 2 | 2 | 1
 | KMF000155 | 16 | 16 | 1
 | [NAME] | 2 | 2 | 1
 | [NAME] | 1 | 1 | 1
 | [NAME] | 14 | 14 | 1
 | KMF000173 | 4 | 4 | 1
 | KMF000175 | 5 | 5 | 1
 | KMF000176 | 3 | 3 | 1
 | KMF000177 | 1 | 1 | 1
 | KMF000178 | 3 | 3 | 1
 | KMF000182 | 1 | 1 | 1
 | KMF000184 | 1 | 1 | 1
 | KMF000185 | 1 | 1 | 1
 | [NAME] | 1 | 1 | 1
 | KMF000203 | 2 | 2 | 1
 | KMF000206 | 5 | 5 | 1
 | [NAME] | 8 | 8 | 1
 | [NAME] | 6 | 6 | 1
 | KMF000218 | 1 | 1 | 1
 | KMF000219 | 1 | 1 | 1
 | KMF000220 | 17 | 17 | 1
 | [NAME] | 13 | 13 | 1
 | KMF000223 | 12 | 12 | 1
 | [NAME] | 1 | 1 | 1
 | KMF000226 | 6 | 6 | 1
 | KMF000227 | 3 | 3 | 1
 | [NAME] | 1 | 1 | 1
 | KMF000229 | 2 | 2 | 1
 | KMF000230 | 2 | 2 | 1
 | [NAME] | 6 | 6 | 1
 | [NAME] | 3 | 3 | 1
 | KMF000247 | 5 | 5 | 1
 | KMF000248 | 9 | 9 | 1
 | KMF000251 | 2 | 2 | 1
 | [NAME] | 17 | 17 | 1
 | KMF000267 | 26 | 26 | 1
 | KMF000268 | 29 | 29 | 1
 | KMF000269 | 25 | 25 | 1
 | KMF000270 | 23 | 23 | 1
 | KMF000271 | 4 | 4 | 1
 | [NAME] | 4 | 4 | 1
 | KMF000274 | 1 | 1 | 1
 | KMF000312 | 11 | 11 | 1
 | KMF000640 | 2 | 2 | 1
 | KMF000652 | 6 | 6 | 1
 | [NAME] | 3 | 3 | 1
 | [NAME] | 2 | 2 | 1
 | KMF000699 | 1 | 1 | 1
 | KMF000700 | 1 | 1 | 1
 | KMF000704 | 2 | 2 | 1
 | [NAME] | 3 | 3 | 1
 | KMF000714 | 2 | 2 | 1
 | KMF000716 | 7 | 7 | 1
 | KMF000720 | 1 | 1 | 1
 | KMF000722 | 2 | 2 | 1
 | KMF000723 | 3 | 3 | 1
 | KMF000733 | 1 | 1 | 1
 | (blank) |  |  | 1
 | (blank) |  |  | 1
 | Grand Total | 2617 | 2617