+ Reply to Thread
Results 1 to 5 of 5

Finding an Average for times

  1. #1
    Registered User
    Join Date
    07-09-2015
    Location
    my house
    MS-Off Ver
    2010
    Posts
    1

    Finding an Average for times

    Ill display below but i figured ill let you know the issue first.

    I have a list of wait times. The time are in the form of either : 20m ; 20min ; 1hr; 15-20 min;15-20 m.

    I want to find and average wait time for different people. The question, i believe is, how can i get rid of the text automatically behind the numbers and also remove the hyphen between some numbers and find thier average, then to be able to just find the average per user. The last part is, seemingly, the easiest part as in i have that for certain. However, i need to get excel to recognize the numbers to be able to find averages to begin with.

    ie:
    time person
    20min 1
    30min 4
    20m 4
    15-20min 2
    1 hr 3




    Hope i am clear enough. Get average times without all the extra characters in the way. I would prefer to use some repeatable and can populate because i am trying to build out a template and have currently almost run to an end. I am not shy in using VBA (have tried a little) but i removed the macros.

    Thanks ahead of time

  2. #2
    Valued Forum Contributor
    Join Date
    04-26-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    502

    Re: Finding an Average for times

    Place =LEFT(A1,LEN(A1)-SUM(LEN(A1)-LEN(SUBSTITUTE(A1,{"m","i","n","h","r","s","t","u"},"")))) in a column next to your time data. You may need a 2nd Column with an if formula to get rid of the 15-20. e;g =IF(B1="15-20",20,0)
    Last edited by BlindAlley; 07-10-2015 at 09:24 PM.

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

    Re: Finding an Average for times

    This seems to work.

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


    Row\Col
    A
    B
    C
    D
    1
    20min 1
    20
    1
    In B1:C5 :=IFERROR(ABS(LOOKUP(100,--RIGHT(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A1,"min",""),"m",""),"hr ","")," ",REPT(" ",99)),(COLUMNS($A:A)-1)*99+1,99),ROW($1:$99)))),"")
    2
    30min 4
    30
    4
    3
    20m 4
    20
    4
    4
    15-20min 2
    20
    2
    5
    1 hr 3
    1
    3


    Edit: I forgot about the averages per user. In D1 this and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 07-11-2015 at 10:39 AM.
    Dave

  4. #4
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Finding an Average for times

    This will deal with making the different time units compatible (and convert to Excel date/time):
    EvaluateTime.jpg

    Add this vba function to a code module, and enter the formula as shown above into cells C2:C7. Formula in G2 is '=AVERAGEIF($A$2:$A$7,$F2,$C$2:$C$7)', copy to G2:G5.
    Please Login or Register  to view this content.

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

    Re: Finding an Average for times

    Arrrrgh! Misinterpreted again. ...

+ 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] Finding Totals of a status type and then average out the duration times
    By RJL3313 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-23-2015, 10:04 AM
  2. [SOLVED] Excel 2007 : Finding a corresponding value multiple times
    By suaravi in forum Excel General
    Replies: 6
    Last Post: 07-17-2012, 07:17 AM
  3. Macro Loop – Find Specific Times, Extract Date, Average Values of Times
    By ExcelQuestFL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-25-2010, 02:50 PM
  4. Average Times
    By Phil999 in forum Excel General
    Replies: 1
    Last Post: 03-07-2009, 04:33 AM
  5. Macro to help sort date - times and average similar times.
    By ferretydeath in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2008, 05:44 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