+ Reply to Thread
Results 1 to 5 of 5

Complex query: mean with respect to time rather than fixed number of cells

  1. #1
    Registered User
    Join Date
    08-27-2014
    Location
    UK
    MS-Off Ver
    14.4.3 for mac
    Posts
    3

    Complex query: mean with respect to time rather than fixed number of cells

    I have a workbook with time in one column and a variable in another column. The variable does not occur regularly. So there are sometimes several variables per second and then, perhaps, a gap of a few seconds. There are tens of thousands of row in my workbook. I need a macro that will take a mean of the variable over a constant time period (say 10 secs), rather than a constant number of rows. This macro should be able to repeat itself until it reaches the bottom of the work book and the output should be recorded in consecutive rows somewhere else in the workbook or in a separate workbook. I have attached an example of the raw data.macro test file.xlsx

    Any help would be appreciated.

    Thanks in advance.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Complex query: mean with respect to time rather than fixed number of cells

    Use SUMIF & COUNTIF So something like sumif(time column,<a1+TIMEVALUE("00:00:10"))/countif(time column,<a1+TIMEVALUE("00:00:10"))
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    08-27-2014
    Location
    UK
    MS-Off Ver
    14.4.3 for mac
    Posts
    3

    Re: Complex query: mean with respect to time rather than fixed number of cells

    Thank you for your help - How do I then get that to repeat?

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Complex query: mean with respect to time rather than fixed number of cells

    sumif(time column,<a1+TIMEVALUE("00:00:10"))/countif(time column,<a1+TIMEVALUE("00:00:10"))


    you'd need to do SUMIFS next, so it shows when > the last check and less than
    sumifs(time column,>a1+TIMEVALUE("00:00:10"),time column,<a1+TIMEVALUE("00:00:20"))/)/countif(time column,<a1+TIMEVALUE("00:00:10"))


    I'll take a look at your test file a bit later.

  5. #5
    Registered User
    Join Date
    08-27-2014
    Location
    UK
    MS-Off Ver
    14.4.3 for mac
    Posts
    3

    Re: Complex query: mean with respect to time rather than fixed number of cells

    Thank you very much

+ 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] Fixed Cell Reference Minus a Fixed Number
    By juddykong in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-03-2013, 03:25 PM
  2. multiple line charts with respect to same time axis
    By rosh@excel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-17-2012, 08:48 AM
  3. Loan Calculator with Terms based on Fixed Payment not a fixed time frame.
    By cc4digital in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2012, 04:49 AM
  4. Adding Fixed Time to Group of Cells
    By schw1927 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-06-2009, 11:56 AM
  5. Substracting a fixed number of hours to a time
    By PauloCR in forum Excel General
    Replies: 5
    Last Post: 09-19-2006, 09:26 AM

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