Pivot Table Help

zonemaster88

New Member
Joined
Sep 15, 2014
Messages
3
Hi, I am trying to get the average cost of items with duplicates of the same item but having different value in a pivot table. I tried looking for an answer on here and was unable to find one.

Ex:
Date Item Cost
8/5 4512 $225
8/5 4514 $425
8/5 4518 $125
8/5 4518 $225
8/5 4504 $375

A pivot table would get the average of $275 when I sort by date. However, the average I am looking for is of all the orders with 4518 combined. This would be $343.75. I understand that I could just sort this by item # but the actual data I'm working with has over 80,000 items (in-practical). Anyone know how to combine item numbers and get the average of combined like items in a pivot table?

Thanks!
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
with helper column as follows :
[TABLE="width: 260"]
<tbody>[TR]
[TD="class: xl64, width: 65"]Date[/TD]
[TD="class: xl64, width: 65"] Item[/TD]
[TD="class: xl64, width: 65"] Cost[/TD]
[TD="class: xl64, width: 65"]helper[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]5-Aug[/TD]
[TD="class: xl64, align: right"]4512[/TD]
[TD="class: xl64, align: right"]225[/TD]
[TD="align: right"]225[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]5-Aug[/TD]
[TD="class: xl64, align: right"]4514[/TD]
[TD="class: xl64, align: right"]425[/TD]
[TD="align: right"]425[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]5-Aug[/TD]
[TD="class: xl64, align: right"]4518[/TD]
[TD="class: xl64, align: right"]125[/TD]
[TD="align: right"]350[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]5-Aug[/TD]
[TD="class: xl64, align: right"]4518[/TD]
[TD="class: xl64, align: right"]225[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]5-Aug[/TD]
[TD="class: xl64, align: right"]4504[/TD]
[TD="class: xl64, align: right"]375[/TD]
[TD="align: right"]375[/TD]
[/TR]
</tbody>[/TABLE]

formula in D2 is =IF(COUNTIF($B$2:B2,B2)>1,"",SUMIF($B$2:$B$6,B2,$C$2:$C$6))

Pivot would give:
[TABLE="width: 139"]
<tbody>[TR]
[TD]Average of helper[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Row Labels[/TD]
[TD]Total[/TD]
[/TR]
[TR]
[TD]4504[/TD]
[TD="align: right"]375[/TD]
[/TR]
[TR]
[TD]4512[/TD]
[TD="align: right"]225[/TD]
[/TR]
[TR]
[TD]4514[/TD]
[TD="align: right"]425[/TD]
[/TR]
[TR]
[TD]4518[/TD]
[TD="align: right"]350[/TD]
[/TR]
[TR]
[TD]Grand Total[/TD]
[TD="align: right"]343.75[/TD]
[/TR]
</tbody>[/TABLE]

With in ∑Values 'helper' set on average.

Would that work?
Unless mistaken Calculated fields do not do to well with sum and count.
 
Upvote 0

Forum statistics

Threads
1,225,686
Messages
6,186,435
Members
453,354
Latest member
Ubermensch22

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