Running Average

%3CLINGO-SUB%20id%3D%22lingo-sub-1499594%22%20slang%3D%22en-US%22%3ERunning%20Average%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1499594%22%20slang%3D%22en-US%22%3E%3CP%3EHelp!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20creating%20a%20budget%20spreadsheet%20where%20I%20can%20enter%20my%20expenses%20for%20each%20month%20into%20a%20separate%20worksheet%20on%20excel.%26nbsp%3B%20I%20would%20like%20to%20keep%20a%20running%20average%20cost%20of%20different%20expenses.%26nbsp%3B%20I%20was%20wondering%20if%20there%20was%20a%20way%20to%20program%20it%20to%20automatically%20take%20the%20average%20of%20the%20cell%20on%20the%20current%20sheet%20as%20well%20as%20that%20same%20cell%20in%20all%20following%20sheets.%26nbsp%3B%20I%20know%20how%20to%20do%20it%20manually%20by%20adding%20the%20current%20month%20every%20time%20I%20create%20a%20new%20sheet%2C%20but%20I%20was%20wondering%20if%20there%20was%20a%20formula%20or%20code%20that%20would%20be%20just%20generic%20of%20%22average%20of%20current%20and%20all%20following%22%20sheets.%20Thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1499594%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%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-1500103%22%20slang%3D%22en-US%22%3ERe%3A%20Running%20Average%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1500103%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F714630%22%20target%3D%22_blank%22%3E%40emmaballer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESince%20you're%20in%20(I%20trust)%20the%20early%20stages%20of%20creating%20this%20budget%20spreadsheet%2C%20I'm%20going%20to%20suggest%20you%20change%20your%20approach%20and%20let%20Excel%20do%20the%20%22heavy%20lifting%22%20of%20giving%20you%20your%20monthly%20averages%2C%20your%20monthly%20totals%2C%20etc.%2C%20by%20category.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20do%20that%2C%20have%20just%20a%20single%20sheet%20into%20which%20you%20enter%20the%20date%20for%20each%20check%20or%20credit%20card%20purchase%20(or%20download%20those%20from%20your%20banks)%2C%20an%20indication%20of%20the%20expense%20category%2C%20etc.%26nbsp%3B%20Then%20use%20the%20Pivot%20Table%20capability%20of%20Excel%20to%20do%20that%20%22heavy%20lifting%22%20that%20you%20want%20it%20to%20do.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20attaching%20a%20very%20simple%20example%20just%20to%20show%20you%20how%20that%20can%20work.%20There%20are%20two%20Pivot%20Tables%20in%20this%20workbook.%3C%2FP%3E%3CP%3EThe%20one%20labeled%20%22Annual%20Summary%22%20displays%20the%20sum%20total%20of%20expenses%20in%20each%20category%20for%20the%20year%20selected%2C%20as%20well%20as%20the%20averages%20for%20that%20year.%3C%2FP%3E%3CP%3EThe%20one%20labeled%20%22Monthly%20Summary%22%20displays%20the%20totals%20for%20each%20category%20for%20each%20month%20in%20the%20years%202019%20and%202020.%20That%20could%20be%20modified%20so%20it%20only%20does%20one%20year.%20In%20fact%2C%20it%20can%20be%20modified%20in%20all%20sorts%20of%20ways.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%20me%20encourage%20you%20to%20play%20around%20with%20this%20way%20of%20doing%20it.%20Add%20some%20expenses.%20Add%20some%20expense%20codes%20in%20the%20%22Codes%22%20tab...%20Then%20when%20you're%20in%20the%20Pivot%20Table%20tabs%2C%20just%20click%20on%20the%20%22Refresh%22%20button%20(in%20the%20image%20below%2C%20it's%20under%20the%20word%20%22Design%22)%20to%20see%20how%20the%20Pivot%20Table%20automatically%20adds%20in%20those%20new%20pieces%20of%20information.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mathetes_0-1593550777569.png%22%20style%3D%22width%3A%20550px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202365i9F0575AC649ACC85%2Fimage-dimensions%2F550x473%3Fv%3D1.0%22%20width%3D%22550%22%20height%3D%22473%22%20title%3D%22mathetes_0-1593550777569.png%22%20alt%3D%22mathetes_0-1593550777569.png%22%20%2F%3E%3C%2FSPAN%3E%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-1500122%22%20slang%3D%22en-US%22%3ERe%3A%20Running%20Average%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1500122%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20%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%20I%20will%20do%20some%20editing%20and%20see%20if%20I%20can%20make%20something%20similar%20to%20that%20work!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1500196%22%20slang%3D%22en-US%22%3ERe%3A%20Running%20Average%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1500196%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F714630%22%20target%3D%22_blank%22%3E%40emmaballer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFeel%20free%20to%20post%20a%20copy%20of%20whatever%20you%20come%20up%20with%20if%20you%20continue%20to%20have%20questions.%20Part%20of%20the%20key%20to%20making%20that%20approach%20work%20dynamically%20is%20in%20having%20the%20ongoing%20expenses%20recorded%20in%20an%20Excel%20Table.%20And%20the%20same%20is%20true%20for%20the%20Budget%20Category%20list%20--%20as%20you%20add%20things%20to%20it%20(or%20modify%20it)%2C%20those%20changes%20are%20automatically%20included%20in%20Pivot%20Tables%2C%20etc%2C%20once%20you%20hit%20%22Refresh%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1500218%22%20slang%3D%22en-US%22%3ERe%3A%20Running%20Average%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1500218%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F714630%22%20target%3D%22_blank%22%3E%40emmaballer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20is%20also%20possible%20to%20create%203D%20range%20references%20of%20the%20form%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3DSheet1%3ASheet4!%24B%242%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EIn%20the%20following%2C%20I%20have%20used%20a%20defined%20name%20'%3CSTRONG%3EValues%3C%2FSTRONG%3E'%20to%20refer%20to%20the%20range%2C%20allowing%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3D%20SUM(Values)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3D%20AVERAGE(Values)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3DCOUNT(Values)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EThe%20number%20of%20functions%20that%20work%20with%203D%20ranges%20is%20very%20limited%20though%2C%20so%20care%20is%20needed%20before%20you%20commit%20to%20such%20a%20strategy.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Help!

 

I am creating a budget spreadsheet where I can enter my expenses for each month into a separate worksheet on excel.  I would like to keep a running average cost of different expenses.  I was wondering if there was a way to program it to automatically take the average of the cell on the current sheet as well as that same cell in all following sheets.  I know how to do it manually by adding the current month every time I create a new sheet, but I was wondering if there was a formula or code that would be just generic of "average of current and all following" sheets. Thanks!

4 Replies
Highlighted

@emmaballer 

 

Since you're in (I trust) the early stages of creating this budget spreadsheet, I'm going to suggest you change your approach and let Excel do the "heavy lifting" of giving you your monthly averages, your monthly totals, etc., by category.

 

To do that, have just a single sheet into which you enter the date for each check or credit card purchase (or download those from your banks), an indication of the expense category, etc.  Then use the Pivot Table capability of Excel to do that "heavy lifting" that you want it to do.

 

I'm attaching a very simple example just to show you how that can work. There are two Pivot Tables in this workbook.

  • The one labeled "Annual Summary" displays the sum total of expenses in each category for the year selected, as well as the averages for that year.
  • The one labeled "Monthly Summary" displays the totals for each category for each month in the years 2019 and 2020. That could be modified so it only does one year. In fact, it can be modified in all sorts of ways.

 

Let me encourage you to play around with this way of doing it. Add some expenses. Add some expense codes in the "Codes" tab... Then when you're in the Pivot Table tabs, just click on the "Refresh" button (in the image below, it's under the word "Design") to see how the Pivot Table automatically adds in those new pieces of information.

mathetes_0-1593550777569.png

 

 

Highlighted

Thank you @mathetes.  I will do some editing and see if I can make something similar to that work!

Highlighted

@emmaballer 

 

Feel free to post a copy of whatever you come up with if you continue to have questions. Part of the key to making that approach work dynamically is in having the ongoing expenses recorded in an Excel Table. And the same is true for the Budget Category list -- as you add things to it (or modify it), those changes are automatically included in Pivot Tables, etc, once you hit "Refresh"

 

Highlighted

@emmaballer 

It is also possible to create 3D range references of the form

=Sheet1:Sheet4!$B$2

In the following, I have used a defined name 'Values' to refer to the range, allowing

= SUM(Values)

= AVERAGE(Values)

=COUNT(Values)

The number of functions that work with 3D ranges is very limited though, so care is needed before you commit to such a strategy.