+ Reply to Thread
Results 1 to 7 of 7

Average between dates with multiple criteria

  1. #1
    Registered User
    Join Date
    01-21-2011
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2003
    Posts
    5

    Average between dates with multiple criteria

    A B C D
    1 Ticket Opened Closed Status
    2 12345 1/1/2011 Open
    3 12346 1/2/2011 2/2/2011 Closed
    4 12347 1/3/2011 2/3/2011 Closed
    5 12348 1/4/2011 2/4/2011 Closed
    6 12347 1/4/2011 2/3/2011 Closed
    7 12349 1/5/2011 2/5/2011 Closed

    Okay, I cant figure this one out and I am new to arrays...

    I need a formula that picks the unique tickets, then averages the number of days the ticket was open, with the criteria that the ticket is Closed and is <= 2/3/2011 and puts the average is cell E1.

    The system may have one ticket, but if we assign 5 units to a single ticket, a report shows all 5 in the report as individual rows. So even though there is a single ticket, taking the average of duplicates skews the information. I hope that explanation of the duplicates makes sense.

    Thanks in advance.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Average between dates with multiple criteria

    So, when there are multiple rows with the same ticket #, you want to calculate your days open based on the first instance?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    01-21-2011
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Average between dates with multiple criteria

    Yeah, its essentially the same ticket so it doesn't matter which it gets really as long as it ignores the other duplicate entries.

  4. #4
    Forum Contributor
    Join Date
    01-11-2011
    Location
    Frederick, MD, USA
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Average between dates with multiple criteria

    So, when you say "averages the days the ticket was open", you really mean counts the days the ticket was open, based on any one of the unique ticket IDs...right?

    And, on the subject of those unique IDs...you really don't care which one? You don't want, say, the longest, or shortest?

  5. #5
    Registered User
    Join Date
    01-21-2011
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Average between dates with multiple criteria

    Ticket 12345 might show up 5 times on the report but each entry will have the same open and closed dates. It won't matter which is used as long as it's used once in the average.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Average between dates with multiple criteria

    Okay, the use of "Open" in column C makes it a bit more complex. I put your date in A9 to make it more versitile (so the final formula refers to <=$A$9.
    I also created a dummy column in F which you can later hide. In F2 dragged down;

    =COUNTIF($A$2:$A2,A2) This points out your first occurance of each number.

    Then in E1, entered as an array formula (CNTRL SHFT ENTER)

    =SUMPRODUCT((IF(ISNUMBER($C$2:$C$7),($C$2:$C$7-$B$2:$B$7),"")),--($F$2:$F$7=1),--($C$2:$C$7<=$A$9))/SUMPRODUCT(--($F$2:$F$7=1),--($C$2:$C$7<=$A$9))

    If entered properly, you'll see brackets around it {}
    Does that work for you?
    Last edited by ChemistB; 01-21-2011 at 05:42 PM.

  7. #7
    Registered User
    Join Date
    01-21-2011
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Average between dates with multiple criteria

    hm.. ok thanks. i was hoping to get something that was going to avoid adding extra columns and what. i hoped the array method would work out

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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