+ Reply to Thread
Results 1 to 4 of 4

Average range of data based on user input

  1. #1
    Registered User
    Join Date
    12-15-2015
    Location
    St. Louis, MO
    MS-Off Ver
    2013
    Posts
    9

    Question Average range of data based on user input

    I have a sub that finds a time value that matches a time input by the user. The user also input the number of rows prior to and after the first occurrence where the time is found in the data set. I would like to average the values for each data point in the specified time range and paste these values to a different worksheet. I have attached a document with a respresentative data set.

    Example: User inputs 9:32, and specifies that 3 cells be used for the average.
    The sub finds cell A6 and sets the limit values 3 above (A9) and below (A3). For each data set (Data 1, 2, 3 etc) I want to get the average between A3 and A9 then enter this value onto a different worksheet
    Attached Files Attached Files
    Last edited by acopp24; 12-28-2015 at 05:13 PM.

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Average range of data based on user input

    Here's a possibility.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by skywriter; 12-28-2015 at 07:54 PM.

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Average range of data based on user input

    Hi acopp24,


    Try the following code which is included in the attached file. Instead of asking for the Time and 'Number of Points', the values are in Cells in the file.
    Please Login or Register  to view this content.
    Lewis
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-15-2015
    Location
    St. Louis, MO
    MS-Off Ver
    2013
    Posts
    9

    Re: Average range of data based on user input

    Thank you for your help. I was able to use LJMetzer's code to generate and display averages

+ 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. Cut and paste a range of cells based on user input
    By MICHAEL BIZ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-24-2015, 01:51 PM
  2. [SOLVED] Average Formula With User Input for Range
    By happyjacjac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2015, 09:59 PM
  3. [SOLVED] Need to let User intput the range row value based on input box
    By bconner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2014, 04:13 PM
  4. Data Input Form with number of line items based on user input
    By j_gideon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2013, 02:54 PM
  5. Calculating Average based on user input?
    By Abgirl in forum Excel General
    Replies: 2
    Last Post: 09-06-2010, 12:40 PM
  6. Sum a range of cells based on user input
    By coachdave in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-03-2009, 10:23 PM
  7. Macro to define name range based on user input
    By truongn2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-03-2007, 08:53 PM

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