Results 1 to 6 of 6

VBA to Sort Data and exclude the negative numbers with respect to time during averaging

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-01-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    136

    VBA to Sort Data and exclude the negative numbers with respect to time during averaging

    I want to write a VB macro that can sort through this data and give me results as indicated in the result section. I will like the macro to take the result section to a new sheet. I have put in the result section here in the same sheet so that you can easily see how the equations are referenced.

    Below are my objectives:
    1. First split the date so that the time can be separated as you can see in the result section were we have date and time -- no longer joined together
    2. For Data AI in the result section: Take the average of the data but exclude the negative data during the average. If all data at that time frame is -999.25 or negative, please return zero.
    3. Let’s take a look at the result section, Cell K8. We can see that it averaged the time for 8:16 (11/21/2013) and excluded the negatives.
    4. The same concept goes for Data AL, AJ and AK.

    Hence I want the macro to sort through the data, extract the time in separate manner, and correspond the time with the actual data (excluding the negative averages). And take the results to a separate sheet

    I have put in a formula in the result section to help you understand how I want the results to be.
    Thanks for your time
    Attached Files Attached Files
    Last edited by vnzerem; 12-17-2013 at 05:20 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sort negative and positive numbers into their own columns?
    By More Cowbell in forum Excel General
    Replies: 6
    Last Post: 01-31-2015, 02:57 PM
  2. Sum of time for consecutive positive/ negative numbers
    By DexterG in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-25-2012, 04:03 AM
  3. Averaging negative numbers (SOLVED)
    By steeler416 in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 03-23-2011, 09:15 PM
  4. [SOLVED] When Averaging a column, exclude value based on another cell value
    By Divercem in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-21-2006, 06:40 PM
  5. Exclude more than one row from data->Sort
    By eZee in forum Excel General
    Replies: 1
    Last Post: 01-25-2006, 03:25 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