+ Reply to Thread
Results 1 to 10 of 10

Successive average

  1. #1
    Registered User
    Join Date
    12-22-2013
    Location
    united states
    MS-Off Ver
    Excel 2013
    Posts
    64

    Successive average

    Hi everyone,

    I am trying to calculate the average in the pivot table, if the row value is less than or equal to the current row value.

    My goal is to understand how long the time is on average up to to a certain day in the month. I would like this to be in a pivot table so I can slice by Region.

    Attached is an example workbook. My desired values can be found in Column B on Sheet2.

    Is there any way to do this?

    Thanks in advance for your help!

    Book1.xlsb

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Successive average

    Have you considered adding a column to your source data and doing your calculations there? Then reference that table as your source in the Pivot.

    Have a look at Sheet1 revised and then the NewPivot sheet.
    Attached Files Attached Files
    Dave

  3. #3
    Registered User
    Join Date
    12-22-2013
    Location
    united states
    MS-Off Ver
    Excel 2013
    Posts
    64

    Re: Successive average

    Yes I did try that. That will work only if I do not intend to add any slicers. I appreciate the help though.

    Is there any way to use a calulated field to achieve this?

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Successive average

    I have never attempted it so I don't know. Sorry

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Successive average

    The whole point of helper columns is so you CAN use those functions with the Pivot Table, and if it works with the PT it works with slicers since those are nothing more than quick filter
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Successive average

    @JBeaucaire:
    if i get what the OP wants, i don't think that works because the the average you worked out in the source data is not based on the region. it does not change accordingly to the slicer. for eg. if i choose East in the slicer, i should get 180 because it would be the total time of 900 over just 5 records for Month 4. but yours would still be 189 because total time is still 3,400 over 18 records.

    i think the PowerPivot would provide a solution, but i'm unfortunately not up for the job! let me just get OP on the route by activating it:
    go to File tab -> Options -> Customize Ribbon -> on the right side, check the option of PowerPivot
    convert data in sheet1 into a table. Select A1 & press CTRL + T
    while A1 still selected, go to POWERPIVOT tab -> Add to Data Model
    you will be brought to this PowerPivot window. Below the data are some cells where you can add something called Measures. This is where someone can hopefully help you with a formula. i am not sure if it's possible to refer to a value in the row labels though. it should go something like this (where i cant figure out the red portion to replace it to look at your month row labels)
    AveTime:=CALCULATE(SUM(Table1[Time])/COUNTA(Table1[Time]),Table1[Day of month]<=1)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Successive average

    I assumed it was working because it was giving the same results as the formulas he's added to the page.

    Perhaps changing the helper column formula to: =AVERAGEIFS(C:C,B:B, "<="&B2,D:D, D2)
    Last edited by JBeaucaire; 09-22-2015 at 01:26 PM.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Successive average

    @ benishiryo

    I cannot find the PowerPivot option or the addin. Suggestions on where to look? Is it called something else also?

  9. #9
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Successive average

    @JBeaucaire:
    just a guess on my part though. you could be right. IF i am guessing right again, your new formula doesn't help too because it is now catered only to 1 region. selecting all region or multiple regions now won't work.

    @FlameRetired:
    i see that your profile states MS-Off Ver 2007 & 2013. PowerPivot is available in the 2013 by default using my steps. in 2010, you have to download it as a free add-in. in 2007, it is not available. you could try this method too:
    https://support.office.com/en-us/art...8-fc4798f39ea8

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Successive average

    benishiryo thank you for responding. Yes I had found that link in my searches. Regedit is no help either because PowerPivot addin is just not there ... so I went on "safari" and finally found this link.

    Read in particular what John Denver and Anita Oakley have to say. The addin is available in Pro Plus version of 2013 only and not Home Office .......

    http://answers.microsoft.com/en-us/o...0-db0d187f65c5

    Again benishiryo thank you.

    Dave

+ 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. Showing next value in a column on successive sheets
    By Qualia.Nine in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-16-2015, 02:04 PM
  2. Successive replacement help.
    By maistral in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-28-2014, 12:58 PM
  3. [SOLVED] How do I set up successive formulas?
    By kangen333 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-16-2013, 02:01 AM
  4. [SOLVED] Macro slows down with each successive run
    By hillbk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-07-2013, 11:45 PM
  5. [SOLVED] Select Successive Rows
    By Floydlevedale in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-09-2012, 03:48 AM
  6. count successive values
    By henneman in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-26-2010, 10:38 AM
  7. Filtering through successive fields
    By Arau in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-23-2008, 07:03 AM

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