+ Reply to Thread
Results 1 to 6 of 6

Formula to calculate sum/average based on number of unique dates in range

  1. #1
    Forum Contributor
    Join Date
    11-13-2013
    Location
    California
    MS-Off Ver
    Excel 365 Apps for enterprise
    Posts
    180

    Formula to calculate sum/average based on number of unique dates in range

    I need to calculate an sum/average, however the divisor may be different based on the number of unique dates for each person.

    Column H has the total hours for the given period.
    Column G has the check dates for the employee.

    So basically I need something like... =sum((H10/(# unique dates in range G5:G9))/2)

    I'm trying to calculate the average # of hours being worked by employees each week. Since the report will also include those who have worked here for a time less than my report range, I need to account for that. We're paid biweekly, so I can only see 2 weeks worth of info at a time, thus why ultimately it then needs to be divided by 2 as the VP wants it based on a weekly #. I would prefer not to have to calculate the # of checks by hand.

    Thanks for helping.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to calculate sum/average based on number of unique dates in range

    For the count of unique dates in the range G5:G9...

    =SUM(--(FREQUENCY(G5:G9,G5:G9)>0))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Contributor
    Join Date
    11-13-2013
    Location
    California
    MS-Off Ver
    Excel 365 Apps for enterprise
    Posts
    180

    Re: Formula to calculate sum/average based on number of unique dates in range

    Quote Originally Posted by Tony Valko View Post
    For the count of unique dates in the range G5:G9...

    =SUM(--(FREQUENCY(G5:G9,G5:G9)>0))


    Did I do it wrong? =SUM((H10/(FREQUENCY(G5:G9,G5:G9)>0))) It gave me a #DIV/0!

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to calculate sum/average based on number of unique dates in range

    Try it like this...

    =H10/SUM(--(FREQUENCY(G5:G9,G5:G9)>0))

  5. #5
    Forum Contributor
    Join Date
    11-13-2013
    Location
    California
    MS-Off Ver
    Excel 365 Apps for enterprise
    Posts
    180

    Re: Formula to calculate sum/average based on number of unique dates in range

    Quote Originally Posted by Tony Valko View Post
    Try it like this...

    =H10/SUM(--(FREQUENCY(G5:G9,G5:G9)>0))
    That works. Too bad I can't make those ranges update for each of my lists.
    Last edited by JennOlsen; 08-19-2014 at 06:51 PM.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to calculate sum/average based on number of unique dates in range

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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: 15
    Last Post: 05-26-2016, 11:52 PM
  2. Calculate number of days between 2 dates & then assign a number based on the answer
    By MrHappyGoLucky12 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-27-2014, 09:20 PM
  3. Replies: 1
    Last Post: 07-18-2013, 10:11 AM
  4. Replies: 4
    Last Post: 10-15-2012, 07:38 AM
  5. Formula to calculate a total in one range based on dates from another column
    By CarolineD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-01-2005, 04:56 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