count unique based on criteria in pivot table

Sharksfan

New Member
Joined
Nov 3, 2017
Messages
22
I have a pivot table in which I need to count unique locations based on inventory program, but not include locations where the sum of available field is equal to 0 - zero. I have uploaded a mini-spreadsheet with data.

DCH Inventory Management.xlsx
ABCDE
1Row Labels
2Allocation - DD Stage
3DCH Hold
4Overage
5Showa Gloves
6Smart Source Gloves
7(blank)
8LocationPart numberUOMInventory ProgramSum of Available
9DT40A1AT73035CSAllocation - DD Stage29
10DT40A288TN04LCSAllocation - DD Stage0
11DT40B188TN02SCSAllocation - DD Stage0
12DT40B1CH6G0048CSAllocation - DD Stage0
13DT40B188RTF04LCSAllocation - DD Stage34
14DT40B29444CSAllocation - DD Stage33
15DT40B28856NMBCSAllocation - DD Stage39
16DT40C19444CSAllocation - DD Stage16
17DT40C28486CSAllocation - DD Stage50
18DT40D18486CSAllocation - DD Stage41
19DT40D27101PGCSAllocation - DD Stage17
20DT41A17101PGCSAllocation - DD Stage18
21DT41A28210CSAllocation - DD Stage40
22DT41B188ES02SCSAllocation - DD Stage19
23DT41B229408CSAllocation - DD Stage12
24DT41B229408CSOverage5
25DT41C129408CSAllocation - DD Stage15
26DT41C28210CSAllocation - DD Stage39
27DT41D188TN04LCSAllocation - DD Stage0
28DT41D229408CSAllocation - DD Stage20
29DT42A188TN02SCSAllocation - DD Stage33
30DT42A188TN03MCSAllocation - DD Stage0
31DT42A28858NXLBCSAllocation - DD Stage25
32DT42A28858NXLBCSDCH Hold10
33DT42A288TN04LCSAllocation - DD Stage0
34DT42B18887DOTPCSAllocation - DD Stage15
35DT42B229408CSAllocation - DD Stage15
36DT42C18886DOTPCSAllocation - DD Stage16
37DT42C288TN05XLCSAllocation - DD Stage15
Inventory by Program
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Maybe try

=COUNTA(UNIQUE(FILTER($A$9:$A$37,$E$9:$E$37>0)))
 
Upvote 0
Solution
Maybe try

=COUNTA(UNIQUE(FILTER($A$9:$A$37,$E$9:$E$37>0)))
I had the COUNTA and UNIQUE functions, but I did not realize there was a Filter function. After learning about the FILTER function, I learned you can filter on multiple criteria in which case I was able to also filter by "inventory program" to get what I needed. Thank you for pointing me in the right direction! complete formula is =COUNTA(UNIQUE(FILTER($A$9:$A$37,($E$9:$E$37>0)*($D$9:$D$37=A2),0))) in cell B2. Then copy down to cell B6.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top