+ Reply to Thread
Results 1 to 5 of 5

Calculate Weighted Average within a date range

  1. #1
    Registered User
    Join Date
    01-02-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    95

    Exclamation Calculate Weighted Average within a date range

    I need to calculate the weighted average with 2 criteria - date range and advisor (file is attached)
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Calculate Weighted Average within a date range

    Hi -

    I think there is some information missing here. Your download has two sheets called "calculate" and "Raw". The Raw data does not have any Advisor listed by name. Also, I'm not sure what you mean by a weighted average. Usually a weighted average means one piece of data multiplied by some factor then divide by the number of data points. However, you don't mention what you want to use for a weighting factor. Any clarification would be appreciated.
    ____________________________________________
    If this has solved your problem, please edit the thread title to add the word [SOLVED] at the beginning. You can do this by
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I have been particularly helpful, please "bump" my reputation by pressing the small star in the lower left corner of my post.

  3. #3
    Registered User
    Join Date
    01-02-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Calculate Weighted Average within a date range

    Quote Originally Posted by loginjmor View Post
    Hi -

    I think there is some information missing here. Your download has two sheets called "calculate" and "Raw". The Raw data does not have any Advisor listed by name. Also, I'm not sure what you mean by a weighted average. Usually a weighted average means one piece of data multiplied by some factor then divide by the number of data points. However, you don't mention what you want to use for a weighting factor. Any clarification would be appreciated.
    Yes Sorry raw data didn't have the advisor column. re-attaching the file. were trying to get the weighted average of the advisor based on a date range - Average per advisor by daterange / count of q1 per advisor by date range. Ihope I make sense.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-02-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Calculate Weighted Average within a date range

    =SUMPRODUCT(q1 score, q1 count)/SUM(q1 count)

    Criteria = date range, advisor

    Were trying to get the weighted average of each advisor

  5. #5
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Calculate Weighted Average within a date range

    Hi -

    I assume you want to use SUMPRODUCT because some of your referenced cells may be in separate files? SUMPRODUCT is the only function that can read closed files. Otherwise AVERAGEIFS would probably be the more efficient function. But, the SUMPRODUCT solution looks like this:

    =IFERROR(SUMPRODUCT((Raw!$J$2:$J$2185=calculate!A4)*(Raw!$C$2:$C$2185>=calculate!$B$1)*(Raw!$C$2:$C$2185<=calculate!$C$1)*(Raw!$I$2:$I$2185))/SUMPRODUCT((Raw!$J$2:$J$2185=calculate!A4)*(Raw!$C$2:$C$2185>=calculate!$B$1)*(Raw!$C$2:$C$2185<=calculate!$C$1)),"")

    First it checks the Advisor name, the next two tests are to collect anything greater than or equal to the start date, and anything less than or equal to the end date. Finally it multiplies the score of each match. The SUMPRODUCT in the denominator is the exact same formula except it doesn't multiply by the score - it's just a count of the number of matches. I noticed for different date ranges that some advisors don't have any data, which will generate an error. That's why I enclosed the whole formula within an IFERROR function that returns "" if there are not matches. "" is ignored in by your AVERAGE formula in cell B15. So if some advisors have no data, you will still get an average of the advisors that do.

    I have attached your file with this formula in the table.
    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)

Similar Threads

  1. How to calculate the weighted average of duration or time
    By BlueCollarCritic in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-03-2016, 04:58 PM
  2. [SOLVED] Using Sumproduct to calculate weighted average
    By Excel15 in forum Excel General
    Replies: 3
    Last Post: 03-11-2015, 10:33 AM
  3. Calculate weighted average for values between two date ranges.
    By chan069 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-25-2014, 01:12 AM
  4. [SOLVED] Help with IF and SUMPRODUCT to calculate weighted average??
    By consulttk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-02-2012, 03:56 PM
  5. How can I calculate a weighted average in a Pivot Table?
    By petevang in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-23-2012, 12:56 PM
  6. Calculate weighted average with missing values
    By Deiseman in forum Excel General
    Replies: 9
    Last Post: 06-08-2010, 10:03 AM
  7. Weighted Average with NA...can't calculate
    By salmanjan in forum Excel General
    Replies: 5
    Last Post: 04-18-2008, 08:24 PM

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