+ Reply to Thread
Results 1 to 7 of 7

Find averages for selected ranges based on inputbox criteria

  1. #1
    Registered User
    Join Date
    10-01-2015
    Location
    Canada
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Find averages for selected ranges based on inputbox criteria

    Hi I'm new to this but I have a spreadsheet with phone call lengths (in seconds) for 3 separate incoming phone lines. I am monitoring the amount of time in seconds that each call takes, row by row, and need to determine average call times in seconds for particular days and for the month.

    I would like to be able to use an INPUTBOX to ask user for date and phone line # (1,2,3 or All Lines) and display average call times for input date. I would like to display the result in a MSGBOX with the option to save result to unused area in spreadsheet

    The following ranges contain the date of each phone call (format "mmm. d")
    (Phone Line 1) A6:A10005
    (Phone Line 2) D6:D10005
    (Phone Line 3) G6:G10005

    The following ranges contain the phone call times in seconds (format [ss] ):
    (Phone Line 1) B6:B10005
    (Phone Line 2) E6:E10005
    (Phone Line 3) H6:H10005

    Cell B2 contains:
    =COUNT(B5:B10005)

    Cell B3 contains:
    =IFERROR(AVERAGE(B5:B10005),"N/A")

    Cells E2,E3, H2, and H3 contain corresponding formulas for their columns


    Not even sure where to begin but any help would be appreciated.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Find averages for selected ranges based on inputbox criteria

    Submit your workbook or a similar example workbook so that we have data to work with. It is important that formatting be identical.
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Registered User
    Join Date
    10-01-2015
    Location
    Canada
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Find averages for selected ranges based on inputbox criteria

    Hopefully I have attached an example file that will help explain. Call times are entered at the end of each actual phone call into the corresponding column and only averages for within the same month are needed. A new spread sheet would be started for each month.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Find averages for selected ranges based on inputbox criteria

    Run macro Show Form to go through the process. The layout of the form can be adapted to suit your needs but keep the names of the controls the same.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-01-2015
    Location
    Canada
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Find averages for selected ranges based on inputbox criteria

    Thanks stnkynts. That's amazing. I can certainly work with that. Plus I've got a feeling I'm going to learn tons just examining the code.

  6. #6
    Registered User
    Join Date
    10-01-2015
    Location
    Canada
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Find averages for selected ranges based on inputbox criteria

    I am trying to make a modification to stnkynts' solution by having the inputbox copy to the next empty cell in column M instead of just cell M1 so as to keep a running tally. But again my limited knowledge is frustrating me. Can you show me how to append column M in this manner?

  7. #7
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Find averages for selected ranges based on inputbox criteria

    see your inbox

+ 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] Delete Worksheets Based on Name from InputBox Criteria
    By d247 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2014, 01:45 AM
  2. Help: Need to function that averages based on several criteria
    By doubleM3000 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2012, 07:01 PM
  3. [SOLVED] Formula that averages percentages based on said criteria
    By Leif Magnus in forum Excel General
    Replies: 3
    Last Post: 09-14-2012, 04:26 PM
  4. [SOLVED] Taking simple averages with variable ranges using multiple criteria
    By Lycium in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-26-2012, 11:20 AM
  5. Replies: 3
    Last Post: 02-12-2011, 12:10 PM
  6. Need help with averages based on criteria.
    By mwmcginnis in forum Excel General
    Replies: 4
    Last Post: 02-27-2009, 06:19 AM
  7. [SOLVED] Trying to find averages based on date.
    By Daesthai in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2006, 02:10 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