+ Reply to Thread
Results 1 to 6 of 6

Help to calculate average based on filtering - including dataset

  1. #1
    Registered User
    Join Date
    08-05-2019
    Location
    Copenhagen
    MS-Off Ver
    Mac
    Posts
    19

    Help to calculate average based on filtering - including dataset

    Hi Everbody :-)

    I have a problem that I have tried to simplify. Basically I have a large data set over some stocks, their monthly stock prices and an indicator whether a stock is a winner or not.

    I need to find the average of the winner stock prices in each month. This can be done manually by filtering by the date and winner and the manually calculate the average. The dataset I have is very big, so I need to find a way where this is not done manually, but maybe by VBA.

    I have attached a simplified dataset where I have done the calculation manually for month 1.

    I hope to hear from you :-)
    Attached Files Attached Files

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Help to calculate average based on filtering - including dataset

    see attached. I used a pivot table.
    Attached Files Attached Files
    Happy with my advice? Click on the * reputation button below

  3. #3
    Registered User
    Join Date
    08-05-2019
    Location
    Copenhagen
    MS-Off Ver
    Mac
    Posts
    19

    Re: Help to calculate average based on filtering - including dataset

    Thank you for the help, maybe I wasn't clear but I need the average for every month in a column or row :-)

  4. #4
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Help to calculate average based on filtering - including dataset

    that's what you've got. There were no 'winners' in month 2 so no data. there was one winner in month 3 which is shown

  5. #5
    Registered User
    Join Date
    08-05-2019
    Location
    Copenhagen
    MS-Off Ver
    Mac
    Posts
    19

    Re: Help to calculate average based on filtering - including dataset

    Ah okay, my bad, thank you so much! :-) Maybe I had simplified the problem to much, because I actually have an extra criteria which is that the company's size is NotSmall, which I can not figure out how to implement using your pivot table. I have added it to you document! I hope you can help, but you help have already been really amazing! :-)
    Attached Files Attached Files
    Last edited by signekolind; 10-19-2020 at 05:11 AM.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,554

    Re: Help to calculate average based on filtering - including dataset

    If I understand correctly then the following may help:
    1. From the PivotTable Tools tab > Analysis sub tab > Change Data Source so that Table/Range reads: Sheet4!$A$1:$E$10
    2. From the same sub tab select Refresh
    3. Put Size in the Filters area
    4. [optional] Put Month in the Filters area
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Replies: 7
    Last Post: 04-22-2020, 11:21 PM
  2. [SOLVED] How to calculate the weighted average without including #N/A
    By tareq5114 in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 03-18-2019, 04:19 AM
  3. Calculate average sum from a dataset?
    By QuantEdge in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-02-2017, 04:24 PM
  4. Replies: 5
    Last Post: 10-29-2014, 08:11 AM
  5. How to calculate average in a large dataset
    By dolle in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-27-2013, 01:08 PM
  6. Filtering on large dataset based on rule
    By not4google in forum Excel General
    Replies: 2
    Last Post: 11-11-2009, 06:15 AM
  7. How to calculate average from large dataset in several sheets?
    By Orf in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-12-2005, 07:10 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