+ Reply to Thread
Results 1 to 8 of 8

Test data reduction macro

  1. #1
    Registered User
    Join Date
    02-14-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Test data reduction macro

    Hi all,


    I have a large amount of test data that I need to process into useable information. Because of my hardware, the test sample rate was over 1000Hertz. Anyway,I need to reduce the length of the columns of test data by averaging them every 17 rows. I attached a sample of the data I am working with, some of the data is over 100,000 rows. I cannot figure out how to begin averaging the data and increment the range until the end of the column. Please help....
    BTW, I am using excel2010, if that matters.



    test book1.xlsx

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Test data reduction macro

    Give this a try,

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Test data reduction macro

    I had a go at it as well.

    Your description said a sample size of 17 but your example workbook had a sample size of 18.

    Change the sample size in the code to suit.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-14-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Test data reduction macro

    AlphaFrog,

    I got a "Type Mismatch" runtime error with your code on the line beginning "Avgs(k) =". No idea why....
    If you can explain, it would help me understand.



    Mike7952's code does what I need to do, my job is to understand how.

    Thanks a lot, both of you!

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Test data reduction macro

    Quote Originally Posted by a1aexcel View Post
    AlphaFrog,

    I got a "Type Mismatch" runtime error with your code on the line beginning "Avgs(k) =". No idea why....
    If you can explain, it would help me understand.
    It worked for me given your example data. Are you using the same worksheet?

    Type mismatch in this case may mean the data it is trying to add is text and not numeric.

  6. #6
    Registered User
    Join Date
    02-14-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Test data reduction macro

    I did use a different sheet.... went back and used a new fresh sheet with raw data which is what my example was, and it worked, with 22,000 data points. Your code was fine, I am apparently the weak link.

  7. #7
    Registered User
    Join Date
    04-18-2013
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Test data reduction macro

    Quote Originally Posted by a1aexcel View Post
    Hi all,


    I have a large amount of test data that I need to process into useable information. Because of my hardware, the test sample rate was over 1000Hertz. Anyway,I need to reduce the length of the columns of test data by averaging them every 17 rows. I attached a sample of the data I am working with, some of the data is over 100,000 rows. I cannot figure out how to begin averaging the data and increment the range until the end of the column. Please help....
    BTW, I am using excel2010, if that matters.



    Attachment 214942
    I will like to use alaexcel test book1.xlsx as an example. I would like to reduce the columns averaging them every 5 rows in reference to the middle number for example rows 1+2+4+5 divided by row 3. I will then have to compare the average of the sumed rows to row 3. if row 3 is greater than the sum of rows 1+2+4+5 then flag it and increment by one. So the next rows will be the average of 2+3+5+6 then this time compare it to row 4 if greater than 8 flag it and repeat the process any help please.

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Test data reduction macro

    Thomas,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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