+ Reply to Thread
Results 1 to 1 of 1

Calculate monthly average in pivot table with distinct count

  1. #1
    Registered User
    Join Date
    05-22-2021
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    38

    Calculate monthly average in pivot table with distinct count

    Greetings,

    I am trying to calculate the average across the total number of months per year wherein the month has either passed or is current, by another variable.

    This post https://www.excelforum.com/excel-cha...vot-table.html actually provides the solution to what I am looking for, but I am tried amending it to include a distinct count of the number of months that satisfy what I just stated. The implication is that the denominator is not biased upwards unnecessarily making the average smaller than it should be.

    I followed the steps exactly as the solution posted, but I still run into an error.

    1. I added a field, call it Sum_Expenses, which has the following formula: =Sum(Expenses_Amount) where Expenses_Amount contains all the expenses I am summing.

    2. I tried to add another field that averages across months, call it Average_Expenses, which has this formula: =[Sum_Expenses]/SUM(IF(ISTEXT('Expense Data'!E2),1/COUNTIF('Expense Data'!E2:E9999,'Expense Data'E2:E9999),"")) where the denominator counts the number of distinct months (text variable) in a year. The numerator and denominator each work fine independently, but when I try to add this field, I get this error (see image attached).

    Note that I used E2:E9999 because for some reason $E:$E doesn't work. Presumably I can run a slicer on the year and the average will adjust accordingly.
    Attached Images Attached Images
    Last edited by 6StringJazzer; 09-03-2023 at 07:20 PM.

+ 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. [SOLVED] Calculate monthly average in pivot table
    By SpongeySquidge in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 09-04-2023, 12:49 AM
  2. How to Get Distinct Values Average While Using Pivot Table
    By atif574 in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 11-29-2022, 12:08 PM
  3. Calculate monthly average in pivot table
    By SpongeySquidge in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-01-2021, 07:04 PM
  4. Replies: 1
    Last Post: 08-31-2020, 11:54 PM
  5. [SOLVED] Count distinct value and SUM in the same Pivot table
    By Faridwahidi in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 03-15-2019, 11:35 AM
  6. Help with distinct count on Pivot table
    By Jonathan11235 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-27-2016, 07:25 AM
  7. [SOLVED] How do I set up Distinct Count in a Pivot Table?
    By STOFF in forum Excel General
    Replies: 1
    Last Post: 04-18-2006, 01:25 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