+ Reply to Thread
Results 1 to 8 of 8

Average # of Days (or Cells) in a Table

  1. #1
    Registered User
    Join Date
    11-09-2015
    Location
    Florida
    MS-Off Ver
    O365
    Posts
    61

    Average # of Days (or Cells) in a Table

    Good Morning Experts! Hoping someone can point me in the right direction. I have a schedule with Start and End dates and "x" or "h" to indicate if someone is on call for that week. Using a random name generator to mix up the names, but I want to make sure everyone has about the same amount of time between duty weeks. Looking for a way to easily see the average, number of days between each on call week. That way I can look and say Joe averages on call about every 6 weeks. Hope this kind of makes sense. Open to any ideas (formual, pivot, macro, etc)....Sample attached.
    Attached Files Attached Files

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

    Re: Average # of Days (or Cells) in a Table

    This proposal employs five helper rows.
    Rows 1:4 are populated using: =IFERROR(AGGREGATE(15,6,(ROW(Table1[John])-ROW(Table1[#Headers]))/(Table1[John]<>""),ROWS(C$1:C1)),"")
    Row 5 is populated using: =IFERROR(AVERAGE(C2-C1-1,C3-C2-1,C4-C3-1),AVERAGE(C2-C1-1,C3-C2-1))
    Note that I assume that since Sam is only on call three times during the year then the average should only take the three values into consideration.
    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.

  3. #3
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,827

    Re: Average # of Days (or Cells) in a Table

    Say you insert a row at the top. In cell C1, use this:
    =(XMATCH(TRUE,ISTEXT(Table1[John]),0,-1)-MATCH(TRUE,ISTEXT(Table1[John]),0)-COUNTA(Table1[John])+1)/(COUNTA(Table1[John])-1)

    Then just drag formula across the table.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-09-2015
    Location
    Florida
    MS-Off Ver
    O365
    Posts
    61

    Re: Average # of Days (or Cells) in a Table

    Thank you JeteMC! That will get the job done!

  5. #5
    Registered User
    Join Date
    11-09-2015
    Location
    Florida
    MS-Off Ver
    O365
    Posts
    61

    Re: Average # of Days (or Cells) in a Table

    Thank you GregB11...nice and concise.

  6. #6
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,827

    Re: Average # of Days (or Cells) in a Table

    You're welcome. Thanks for the rep and feedback!

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

    Re: Average # of Days (or Cells) in a Table

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

  8. #8
    Registered User
    Join Date
    10-28-2022
    Location
    Los Angeles, California
    MS-Off Ver
    Standard
    Posts
    3

    Re: Average # of Days (or Cells) in a Table

    Thank you! It helped me.

+ 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. [SOLVED] i need to Calculate the average days the tickets have been open in the past 30 days
    By Reece_Norman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-10-2022, 12:48 PM
  2. [SOLVED] Average over last 120 days with blank cells
    By KrystyneT in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-29-2020, 12:50 PM
  3. Average no. of days if other cells meet multiple criteria
    By Elderlyoutlaw in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-16-2019, 04:01 PM
  4. Replies: 2
    Last Post: 04-17-2018, 09:45 PM
  5. Replies: 7
    Last Post: 05-04-2017, 10:53 AM
  6. Replies: 7
    Last Post: 11-29-2016, 07:12 AM
  7. Replies: 13
    Last Post: 09-22-2016, 09:18 AM

Tags for this Thread

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