+ Reply to Thread
Results 1 to 6 of 6

Pivot table and calculations

  1. #1
    Registered User
    Join Date
    07-28-2008
    Location
    Switzerland
    Posts
    19

    Pivot table and calculations

    Hi all!

    I am currently really stuck on a certain project of mine and I'm looking for a solution to make my life a lot easier. I am interested in calculating, from a pivot table, averages of certain values within a specific time frame.

    For example:

    I am interested in only the deals withing a month's timeframe (1st-28th/30th/31st), and for each of these deals that qualify I wish for excel to identify them and add all the costs and then divide by the quanitity (as to receive an average). Is this possible? Can excel identify monthly parameters and then proceed to add the costs of those who qualify and divide by the quantity? Any help would be greatly appreciated! Thank you very much!

  2. #2
    Valued Forum Contributor Rahul Nagar's Avatar
    Join Date
    09-18-2008
    Location
    nasik
    MS-Off Ver
    Excel 2003
    Posts
    465

    Re: Pivot table and calculations

    Hi,
    It is easier to understand if you can attach one sample file with the post.
    __________________
    Regards
    Rahul Nagar
    Founder of www.myshortcutkeys.com.


    If you get the answer of your questions then please click EDIT in your original post then click on GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.

  3. #3
    Registered User
    Join Date
    07-28-2008
    Location
    Switzerland
    Posts
    19

    Re: Pivot table and calculations

    Allow me to rephrase my question.

    I have a start date in one colum and an end date in another column for a variety of projects.

    I also have daily values corresponding to each day for an entire year.

    I need somehow to make it so that Excel will take the dates between the start and end date (including the start and end date), and find an average value across all these days with the help of daily corresponding values. I tried using a VLOOKUP function but my success was limited to only managing to get the averages of the start and the end date, and not the average value of all the dates also in between the start and end date.

    Thank you!

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Pivot table and calculations

    Hi, just an attempt: column A starting dates, B ending dates, C values

    =AVERAGE(INDIRECT("C"&MATCH(Start date,A2:A100,0)+1&":"&"C"&MATCH(End date,B2:B100,0)+1))

    I've attached a brief example

    Cheers
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-28-2008
    Location
    Switzerland
    Posts
    19

    Re: Pivot table and calculations

    That formula seems to do something but its not collecting the right numbers. In your example there was a project starting every day but that is no the case with the data that I'm using. How can I change that? Is it possible to do this without a VLOOKUP function?

  6. #6
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Pivot table and calculations

    Hi,
    attached it's another example about how to calculate an average.

    =SUMPRODUCT((A2:A100="A")*(B2:B100>=B5)*(C2:C100<=C15)*(D2:D100)/(SUMPRODUCT(--(A2:A100="A"))))

    Column A name of projects, B beginning date (b5) , C ending date (c15) , D values.

    Maybe a sample file from you could help friends of the Forum in finding better solutions.

    Cheers
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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