+ Reply to Thread
Results 1 to 10 of 10

Calculating the average no. of staff per week

  1. #1
    Forum Contributor
    Join Date
    03-09-2014
    Location
    Telford
    MS-Off Ver
    Microsoft 365
    Posts
    101

    Calculating the average no. of staff per week

    Hi Guys

    I want a formula to calculate the average number of staff working per week in the attached data. Any help?


    Many thanks
    Attached Files Attached Files

  2. #2
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Calculating the average no. of staff per week

    Hi,

    Please see the attached file. I could do this with the help of a Pivot Table after adding 2 helper columns to the data source.
    Attached Files Attached Files
    Last edited by cbatrody; 08-04-2014 at 11:18 AM.

  3. #3
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Calculating the average no. of staff per week

    Without the Pivot Table. This is an array formula, please press CTRL+SHIFT+ENTER to confirm.

    Please SORT the Data -> Week first (smallest to largest) & Staff A-Z before applying the formula.

    =SUM(IF(A2:A4989&B2:B4989<>A1:A4988&B1:B4988,1,0))/SUM(IF(A2:A4989<>A1:A4988,1,0))
    Attached Files Attached Files
    Last edited by cbatrody; 08-04-2014 at 11:20 AM.

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Calculating the average no. of staff per week

    =SUM(IF(FREQUENCY(COUNTIF(B2:B4989,">="&B2:B4989)+MATCH(A2:A4989,A2:A4989,0)*1000,COUNTIF(B2:B4989,">="&B2:B4989)+MATCH(A2:A4989,A2:A4989,0)*1000)>0,1,0))/SUM(IF(FREQUENCY(MATCH(A2:A4989,A2:A4989,0)*1000,MATCH(A2:A4989,A2:A4989,0)*1000)>0,1,0))
    Try this formula
    Otherwise give expected Result
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Calculating the average no. of staff per week

    Try

    COUNTA(A2:A5000)/SUMPRODUCT((A2:A5000<>"")/COUNTIF(A2:A5000,A2:A5000&""))
    Click just below left if it helps, Boo?ath?

  6. #6
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Calculating the average no. of staff per week

    Try

    COUNTA(A2:A5000)/SUMPRODUCT((A2:A5000<>"")/COUNTIF(A2:A5000,A2:A5000&""))

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

    Re: Calculating the average no. of staff per week

    Does this do what you want?
    It required some "helper" columns for the problem to "explain itself" to me as I went.
    The final answer you seek is in your yellow highlighted cell.

    Hope this helps.


    Calculating the average no. of staff per week.xlsx

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Calculating the average no. of staff per week

    =SUM(IF(FREQUENCY(COUNTIF(B2:B4989,">="&B2:B4989)+MATCH(A2:A4989,A2:A4989,0)*1000,COUNTIF(B2:B4989,">="&B2:B4989)+MATCH(A2:A4989,A2:A4989,0)*1000)>0,1,0))/SUM(IF(FREQUENCY(MATCH(A2:A4989,A2:A4989,0)*1000,MATCH(A2:A4989,A2:A4989,0)*1000)>0,1,0))
    this will solve your problem without helper column try it

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

    Re: Calculating the average no. of staff per week

    Quote Originally Posted by nflsales View Post
    =SUM(IF(FREQUENCY(COUNTIF(B2:B4989,">="&B2:B4989)+MATCH(A2:A4989,A2:A4989,0)*1000,COUNTIF(B2:B4989,">="&B2:B4989)+MATCH(A2:A4989,A2:A4989,0)*1000)>0,1,0))/SUM(IF(FREQUENCY(MATCH(A2:A4989,A2:A4989,0)*1000,MATCH(A2:A4989,A2:A4989,0)*1000)>0,1,0))
    this will solve your problem without helper column try it
    So it does.
    Amazing formula, nflsales.

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

    Re: Calculating the average no. of staff per week

    Try this one.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    It does not have to be array entered.

    This one works, too.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Hope this helps.
    Last edited by FlameRetired; 08-26-2014 at 10:53 PM. Reason: Another new formula

+ 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: 6
    Last Post: 05-16-2014, 11:30 AM
  2. Replies: 0
    Last Post: 01-21-2013, 08:46 AM
  3. calculating average against a group and week number
    By HiltonC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-09-2013, 08:58 PM
  4. Calculating Average Weight Gain Per Week
    By erin1684 in forum Excel General
    Replies: 4
    Last Post: 07-13-2010, 01:23 PM
  5. [SOLVED] Calculating a Date Based on Year, Week Number and Day of the Week
    By amy in forum Tips and Tutorials
    Replies: 1
    Last Post: 08-23-2005, 11:42 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