SOLVED

Calculate Monthly Average on a Pivot Table

%3CLINGO-SUB%20id%3D%22lingo-sub-2668051%22%20slang%3D%22fr-FR%22%3ECalculate%20Monthly%20Average%20on%20a%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2668051%22%20slang%3D%22fr-FR%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3EI%20have%20a%20table%20with%20all%20my%20daily%20expenses%20(that%20I%20extracted%20from%20my%20credit%20card%20reports).%20I%20made%20categories%20and%20subcategories%20for%20these%20expenses%3C%2FP%3E%3CP%3EI%20created%20a%20Pivot%20Table%20to%20group%20these%20expenses%20by%20year%2C%20month%20and%20so%20on...%3C%2FP%3E%3CP%3EBut%20what%20I'd%20like%20is%20a%20way%20to%20get%20an%20average%20of%20these%20expenses%20per%20year%20and%20per%20month.%20I%20mean%2C%20for%20example%2C%20average%20of%20my%20Grocery%20Shopping%20in%202021.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20to%20get%20the%20Average%20with%20the%20Average%20field%20of%20the%20Pivot%20Table%20but%20it%20doesn't%20work%20as%20expected%3A%3C%2FP%3E%3CP%3EFor%20example%2C%20in%20the%20row%20%22Amelia%22%20and%20the%20subrow%20%22Deporte%20y%20Gimnasio%22%2C%20for%202021%2C%20the%20average%20is%20-35.%20Probably%20because%20I%20have%203%20itmes%20%22Deporte%20y%20Gimnasio%22%20in%202021%20that%20sums%20up%20to%20-105.%20But%20what%20I%20would%20like%20is%20to%20get%20the%20monthly%20average%2C%20in%20that%20case%20105%2F8%20%3D%2013%2C125%20...%20(divided%20by%208%20because%20August%20is%20so%20far%20the%208th%20month%20of%20the%20year)...%20Of%20course%2C%20for%202020%20that%20average%20would%20be%2C%20for%20the%20same%20row%20Amelia%20and%20category%20%22Deporte%20y%20Gimnasio%22%2C%206%2F12%20%3D%200%2C5.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20date%20fields%20are%20correctly%20formatted%20as%20date%2C%20and%20days%2Fmonths%2Fyears%20are%20correctly%20recognized...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20I%20made%20it%20clear.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance%3C%2FP%3E%3CP%3ENicholas.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2668051%22%20slang%3D%22fr-FR%22%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2671800%22%20slang%3D%22en-US%22%3ERe%3A%20Calculate%20Monthly%20Average%20on%20a%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2671800%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1132992%22%20target%3D%22_blank%22%3E%40nicolasdaudin%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20do%20the%20same%20thing%20with%20my%20Pivot%20Table%20that%20tracks%20my%20checking%20accounts%20AND%20my%20credit%20cards%2C%20by%20budget%20categories%2C%20I%20use%20the%20Pivot%20Table%20to%20do%20the%20monthly%20totals%20and%20just%20create%20a%20separate%20column%20off%20to%20the%20side%20(NOT%20part%20of%20the%20Pivot%20Table%20but%20adjacent%20to%20it)%20and%20calculate%20the%20averages%20there.%20Perhaps%20that%20will%20work%20adequately%20for%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2671872%22%20slang%3D%22en-US%22%3ERe%3A%20Calculate%20Monthly%20Average%20on%20a%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2671872%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1132992%22%20target%3D%22_blank%22%3E%40nicolasdaudin%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%2C%20instead%20of%20SUM(Values)%20%2F%20COUNT(Values)%20you%20need%20as%20average%3C%2FP%3E%0A%3CP%3ESUM(Values)%20%2F%20COUNT(months%20in%20the%20period)%3C%2FP%3E%0A%3CP%3EThat's%20easy%20to%20do%20with%20data%20model%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20269px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F304876iD19793CCF52567C1%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Ebut%20afraid%20it's%20still%20not%20available%20for%20Excel%20on%20Mac.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2671906%22%20slang%3D%22en-US%22%3ERe%3A%20Calculate%20Monthly%20Average%20on%20a%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2671906%22%20slang%3D%22en-US%22%3ESo%20my%20solution%20(calculate%20average%20monthly%20off%20to%20the%20side)%20DOES%20work%20on%20the%20Mac%2C%20which%20is%20also%20the%20environment%20in%20which%20I%20work.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2671933%22%20slang%3D%22en-US%22%3ERe%3A%20Calculate%20Monthly%20Average%20on%20a%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2671933%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENot%20sure%20it's%20the%20same.%20For%20example%2C%20you%20have%20only%20one%20%24100%20expense%20in%20May.%20When%20average%20for%20year%202021%20will%20be%20100%2F8%3B%20average%20for%201H2021%20is%20100%2F6%3B%20average%20for%202Q2021%20is%20100%2F3%20and%20for%20other%20quarters%20is%200%2F3.%20Finally%20average%20for%20May%20is%20100%2F1%20and%20for%20other%20months%20is%20zero.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,

I have a table with all my daily expenses (that I extracted from my credit card reports). I made categories and subcategories for these expenses

I created a Pivot Table to group these expenses by year, month and so on...

But what I'd like is a way to get an average of these expenses per year and per month. I mean, for example, average of my Grocery Shopping in 2021. 

I tried to get the Average with the Average field of the Pivot Table but it doesn't work as expected:

For example, in the row "Amelia" and the subrow "Deporte y Gimnasio", for 2021, the average is -35. Probably because I have 3 itmes "Deporte y Gimnasio" in 2021 that sums up to -105. But what I would like is to get the monthly average, in that case 105/8 = 13,125 ... (divided by 8 because August is so far the 8th month of the year)... Of course, for 2020 that average would be, for the same row Amelia and category "Deporte y Gimnasio", 6/12 = 0,5.

 

My date fields are correctly formatted as date, and days/months/years are correctly recognized...

 

I hope I made it clear. 

 

Thanks in advance

Nicolas.

9 Replies

@nicolasdaudin 

 

When I do the same thing with my Pivot Table that tracks my checking accounts AND my credit cards, by budget categories, I use the Pivot Table to do the monthly totals and just create a separate column off to the side (NOT part of the Pivot Table but adjacent to it) and calculate the averages there. Perhaps that will work adequately for you.

 

 

@nicolasdaudin 

So, instead of SUM(Values) / COUNT(Values) you need as average

SUM(Values) / COUNT(months in the period)

That's easy to do with data model

image.png

but afraid it's still not available for Excel on Mac. 

So my solution (calculate average monthly off to the side) DOES work on the Mac, which is also the environment in which I work.

@mathetes 

Not sure it's the same. For example, you have only one $100 expense in May. When average for year 2021 will be 100/8; average for 1H2021 is 100/6; average for 2Q2021 is 100/3 and for other quarters is 0/3. Finally average for May is 100/1 and for other months is zero.

It all depends on how you're using the monthly averages for budget tracking and planning purposes. If, for example, I only have one expense for auto insurance--say $700 in May--but that covers the year's auto insurance, it still is legit to say that the average monthly expense is 700/12 and I might need to plan to accumulate cash at that rate to pay for next year's insurance.

As is often the case, not only does excel offer multiple ways to do the same thing; there are different meanings assigned to the same words: so what do we mean when we talk of "average monthly"? And those definitions of meaning affect the Excel method to resolve.
Hi guys, first thanks to both of you Sergei and Mathetes!
By "average monthly" i mean the total spent during the year divided by the number of months of the year (12 for a finished year, less than 12 if the year is not over). My idea is to compare categories and their spendings. I want a monthly average, not an expense average (I just realized that this is what I get when using the average thing in the pivot table, for example one expense of 6 euros => average is 6 euros. )
Hi Sergei thank you!
What do you mean by "with data model". You mean my raw data, and directly calculate there in the excel sheet instead of using the pivot table?
best response confirmed by nicolasdaudin (New Contributor)
Solution

@nicolasdaudin 

That's for Windows:

- creating PivotTable you have an option to add data to data model

image.png

- in data model you have an option to add measures

image.png

- for above sample measure could be

image.png

which we may use in PivotTable.

I attached the file with the sample, you may try to open it. I'm not on Mac, but as I know it doesn't support such functionality. Perhaps something changes recently.

thank you, I'm gonna try!