+ Reply to Thread
Results 1 to 3 of 3

Making calculations based on data appearing on Pivot Table (not its source data)

  1. #1
    Registered User
    Join Date
    07-22-2020
    Location
    Ottawa, Canada
    MS-Off Ver
    Office 2013
    Posts
    1

    Making calculations based on data appearing on Pivot Table (not its source data)

    Hello!

    I have attached a sample sheet.

    In this sheet, you will notice:
    - John has purchased breakfast 2 times
    - Sarah has purchased lunch 2 times
    - Steve has purchased dinner 2 times

    I want my pivot table to have an additional column showcasing the "Average cost of each transaction". Is there some function that would allow me to show what the average cost of each individual's meals are? Can this be done without modifying the source table?

    I have to perform such a calculation for thousands of cells but everytime I try and add a calculated field with "Total/ID" it returns the calculation using the "ID" from the source data and not the "Count of ID" we see in the pivot table. So for Steve's dinner, it wont calculate "$65/2" it will calculate "$65/A132"

    Any help would be very much appreciated!!! This has been bothering me all morning
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: Making calculations based on data appearing on Pivot Table (not its source data)

    Hello MindYourLanguage and Welcome to Excel Forum.
    Try pasting the following into cell E2 on Sheet2 and copying down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: Making calculations based on data appearing on Pivot Table (not its source data)

    Apologies, I failed to say that I had changed the layout of the pivot table to tabular and the field setting of Group to repeat item labels.
    I have also thought of another possible solution that involves Power Pivot.
    The explicit measure (select the data tab and then select manage data model) that calculates the average cost is: Av. Cost:=AVERAGE(Table1[Total])
    The measure is formatted as currency.
    The GETPIVOTDATA formula is applied to the pivot table on the left and the explicit measure is used in the pivot table on the right of Sheet2.
    Let us know if you have any questions.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 01-23-2020, 05:45 PM
  2. [SOLVED] Markers appearing on pivot chart when there is no data in pivot table
    By Tamarissa in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 04-17-2017, 11:28 AM
  3. Replies: 0
    Last Post: 01-06-2016, 07:00 AM
  4. Data source for pivot table based on contents of cell
    By FernTurpin in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 06-23-2015, 11:39 AM
  5. Change Pivot Table Data Source based on Dynamic Range
    By hamidxa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2014, 04:46 PM
  6. Replies: 7
    Last Post: 02-14-2013, 01:32 PM
  7. Pivot Table data source "data source contains no visible tables"
    By Jane in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-29-2005, 04:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1