Sum Distinct within PivotTable?

TheMacroNoob

Board Regular
Joined
Aug 5, 2022
Messages
52
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am trying to use PivotTables to summarize and filter data. I have various tables that all do what I want, except for one.
I have a list of RMs (People), their Units Under Management, and Total Claim Cost per RM. Some properties have multiple claims, thus repeating data such as Unit count.
(A property with 100 units might have 3 claims, making the PivotTable display 300 units.)

Is there any way to make a PivotTable sumdistinct, or something similar, to display the RM, their units under management (counting the units for a property only once), and their total cost?

Please advise if you know the solution off the top of your head. Thank you very much.

Problem Example.xlsm
ABCDEFGHIJKLMNO
1DataProblemDesired Result (Reality)Comparison
2PropertyMax of UnitsSum of Incurred TotalRMSum of UnitsSum of Incurred TotalRMUnitsSum of Incurred TotalBen (wrong)Ben (correct)
3100250$150,000.00Amy650$662,407.90Amy350$662,407.90Units1065515
4101500$180,459.00Ben1065$5,052,489.80Ben515$5,052,489.80
5102100$19,795.00Clarissa200$647,976.00Clarissa200$647,976.00
6103300$49,594.00Daryn20$826,395.80Daryn20$826,395.80
7104400$683,140.00Jamie125$643,325.60Jamie125$643,325.60
8105200$647,976.00Jason650$1,162,045.90Jason325$1,162,045.90
910650$665,044.00John100$19,795.00John100$19,795.00
1010775$1,012,045.90Josh1000$180,459.00Josh500$180,459.00
11108100$1,134,092.70Phil175$673,837.30Phil175$673,837.30
1210950$612,813.90Sharlene100$665,044.00Sharlene50$665,044.00
13110125$643,325.60Ted1200$2,427,466.70Ted600$2,427,466.70
14111175$673,837.30Grand Total5285129612432960$12,961,243.00
15112150$3,000,466.20This is a problem because the This desired result shows the RM and their
1611320$826,395.80PivotTable is summing the unitstotal units under management, without
17114200$1,744,326.70summing the units, adding the duplicating properties by claims
18115265$917,930.90same property values however
19Grand Total500$12,961,243.00many times there are claims I would like it to sum units per property
20(in that property)Sum Distinct units based on ID
PivotTables
Cell Formulas
RangeFormula
J3J3=DATA!R8+DATA!R19
K3:K13K3=SUMIF(DATA!$H:$H,PivotTables!I3,DATA!$S:$S)
J4J4=DATA!R17+DATA!R22+DATA!R29
J5J5=DATA!R12
J6J6=DATA!R26
J7J7=DATA!R20
J8J8=DATA!R3+DATA!R15
J9J9=DATA!R7
J10J10=DATA!R5
J11J11=DATA!R21
J12J12=DATA!R13
J13J13=DATA!R10+DATA!R27
J14:K14J14=SUM(J3:J13)
N3N3=GETPIVOTDATA("Units",$E$2,"RM","Ben")
O3O3=J4
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I forgot to post my data. Apologies.

Problem Example.xlsm
ABCDEFGHIJKLMNOPQRSTUV
2Claim NumberIDNameCombined NameStateCityCrime LevelRMRMMYear Built or RehabYearYear CategoryBuilding AgeLoss DateCause CategoryCauseDetail CauseUnitsIncurred TotalPaid TotalOutstanding TotalIncurred per Door
31100Potato100 - PotatoMEAugustaHighJasonRebeccaYear Built200211-202011/14/2019WindWind - DamageWind - Damage Onsite250$100,000$10,000$90,000$400
41100Potato100 - PotatoMEAugustaHighJasonRebeccaYear Built200211-20205/14/2020WindWind - DamageWind - Damage Onsite250$50,000$25,000$25,000$200
51101Cheese101 - CheeseAZPhoenixHighJoshRebeccaYear Built200311-20196/9/2019WindWind - DamageWind - Damage Onsite500$12,523$3,250$298$25
61101Cheese101 - CheeseAZPhoenixHighJoshRebeccaYear Built200311-20197/4/2021WindWind - DamageWind - Damage Onsite500$167,936$2,356$165,580$336
71102Burger102 - BurgerMEBangorHighJohnRebeccaYear Built200411-20186/8/2019WindWind - DamageWind - Damage Onsite100$19,795$26$19,769$198
81103Apple103 - AppleARCityHighAmyRebeccaYear Built200511-201712/31/2020WindWind - DamageWind - Damage Onsite300$29,797$1,323$28,474$99
91103Apple103 - AppleARCityHighAmyRebeccaYear Built200511-20172/9/2021WindWind - DamageWind - Damage Onsite300$19,797$2,326$17,471$66
101104Mac n Cheese104 - Mac n CheeseAKAnchorageHighTedBrianYear Built200611-20167/9/2021WindWind - DamageWind - Damage Onsite400$205,263$200,000$5,263$513
111104Mac n Cheese104 - Mac n CheeseAKAnchorageHighTedBrianYear Built200611-20167/5/2021WindWind - DamageWind - Damage Onsite400$477,877$2,563$475,314$1,195
121105Pasta105 - PastaMEFarmingdaleHighClarissaBrianYear Built200711-20152/1/2019WindWind - DamageWind - Damage Onsite200$647,976$12,564$635,412$3,240
131106Chicken106 - ChickenMNEden PrairieHighSharleneBrianYear Built200811-20143/19/2019WindWind - DamageWind - Damage Onsite50$136,568$3,164$133,404$2,731
141106Chicken106 - ChickenMNEden PrairieHighSharleneBrianYear Built200811-20146/7/2022WindWind - DamageWind - Damage Onsite50$528,476$40,945$487,531$10,570
151107Grapes107 - GrapesMNSt. AnthonyHighJasonBrianYear Built200911-20134/4/2019WindWind - DamageWind - Damage Onsite75$490,767$43,797$446,970$6,544
161107Grapes107 - GrapesMNSt. AnthonyHighJasonBrianYear Built200911-20133/2/2021WindWind - DamageWind - Damage Onsite75$521,279$46,650$474,629$6,950
171108Turkey108 - TurkeyMNBloomingtonHighBenPaulYear Built201011-20126/8/2019WindWind - DamageWind - Damage Onsite100$551,791$49,502$502,289$5,518
181108Turkey108 - TurkeyMNBloomingtonHighBenPaulYear Built201011-201212/31/2020WindWind - DamageWind - Damage Onsite100$582,302$52,354$529,948$5,823
191109Oranges109 - OrangesIASioux CityHighAmyPaulYear Built201111-20112/9/2021WindWind - DamageWind - Damage Onsite50$612,814$55,207$557,607$12,256
201110Beetroot110 - BeetrootTXHoustonHighJamiePaulYear Built20120-10107/9/2021WindWind - DamageWind - Damage Onsite125$643,326$58,059$585,267$5,147
211111Pumpkin111 - PumpkinTXBeaumontHighPhilRonYear Built20130-1097/5/2021WindWind - DamageWind - Damage Onsite175$673,837$60,911$612,926$3,850
221112Pancakes112 - PancakesTXBeaumontHighBenRonYear Built20140-1082/1/2019WindWind - DamageWind - Damage Onsite150$704,349$63,764$640,585$4,696
231112Pancakes112 - PancakesTXBeaumontHighBenRonYear Built20140-1083/19/2019WindWind - DamageWind - Damage Onsite150$734,861$66,616$668,245$4,899
241112Pancakes112 - PancakesTXBeaumontHighBenRonYear Built20140-1086/7/2022WindWind - DamageWind - Damage Onsite150$765,372$69,468$695,904$5,102
251112Pancakes112 - PancakesTXBeaumontHighBenRonYear Built20140-1084/4/2019WindWind - DamageWind - Damage Onsite150$795,884$72,321$723,564$5,306
261113Sausage113 - SausageMOSt. LouisHighDarynRonYear Built20150-1073/2/2021WindWind - DamageWind - Damage Onsite20$826,396$75,173$751,223$41,320
271114Lemon114 - LemonILMt. VernonHighTedRonYear Built20160-1066/8/2019WindWind - DamageWind - Damage Onsite200$856,908$78,025$778,882$4,285
281114Lemon114 - LemonILMt. VernonHighTedRonYear Built20160-10612/31/2020WindWind - DamageWind - Damage Onsite200$887,419$80,878$806,542$4,437
291115Tomato115 - TomatoMOJenningsHighBenRonYear Built20170-1052/9/2021WindWind - DamageWind - Damage Onsite265$917,931$83,730$834,201$3,464
DATA
Cell Formulas
RangeFormula
L3:L29L3=IFERROR(IF(AND($K3>='[062922 Property Claim Data.xlsm]Year Ranges'!$D$5,'[062922 Property Claim Data.xlsm]Year Ranges'!$E$5>=$K3),'[062922 Property Claim Data.xlsm]Year Ranges'!$C$5,IF(AND($K3>='[062922 Property Claim Data.xlsm]Year Ranges'!$D$6,'[062922 Property Claim Data.xlsm]Year Ranges'!$E$6>=$K3),'[062922 Property Claim Data.xlsm]Year Ranges'!$C$6,IF(AND($K3>='[062922 Property Claim Data.xlsm]Year Ranges'!$D$7,'[062922 Property Claim Data.xlsm]Year Ranges'!$E$7>=$K3),'[062922 Property Claim Data.xlsm]Year Ranges'!$C$7,IF($K3<='[062922 Property Claim Data.xlsm]Year Ranges'!$D$8,'[062922 Property Claim Data.xlsm]Year Ranges'!$C$8,NA())))),"Unknown")
M3:M29M3=IFERROR(YEAR(TODAY())-$K3,"Unknown")
U3:U4,U6:U29U3=S3-T3
V3:V29V3=S3/R3
D3:D29D3=TEXTJOIN(" - ",,B3,C3)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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