LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 4
Default Average data based on unique change in date, ignoring time

Hi,

I have a question that is probably a combination of VBA & Excel formulas, so if I put this in the wrong location, please let me know & I'll move it.

Anyway, I have a CSV data file with 3 columns:

Column 1 Column 2 Column 3
(Text) Date (in the following format) Data (floating point)
a 9/19/2013 12:02:00 AM 6.58667
b 9/19/2013 12:03:00 AM 6.44361
c 9/19/2013 12:04:00 AM 6.32134
d 9/19/2013 12:05:00 AM 6.54321
e 9/20/2013 7:26:00 PM 10.11111
f 9/20/2013 7:27:00 PM 10.23345
g 9/20/2013 7:28:00 PM 10.54321
h 9/20/2013 7:29:00 PM 10.67890
i 9/21/2013 11:58:00 PM 3.12345
j 9/21/2013 11:59:00 AM 3.54321
k 9/21/2013 12:00:00 PM 4.11111
l 9/21/2013 12:01:00 PM 4.54321


The goal is to take an average of the Data in Column 3 for each instance when the Date in Column 2 changes, ignoring the time.

So, in the example above, the result would be 2 more columns, each with the following data:

Column 4 Column 5
(Unique Dates) (Average of each Date)
9/19/2013 6.4737075
9/20/2013 10.3916675
9/21/2013 3.830245

If this can be automated such that, when the CSV file is pulled into Excel, a macro can be run to produce Columns 4 & 5, that would be the most ideal solution. I am confused as to what commands in VBA would use only the unique instances of the date, ignoring the time.

If not, any assistance would be appreciated.

Thanks in advance,
Rob
Excel 2007

P.S. sorry that the formatting isn't coming out correctly - please let me know what I'm doing wrong & I'll correct it.

Last edited by rbrookov : October 8th 13 at 06:28 PM Reason: put in version of Excel
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate Average of an Array of Data for numbers less than 22, while ignoring blanks bertificado Excel Discussion (Misc queries) 0 December 6th 10 01:19 PM
removing/ignoring time in a date time field Jeff Excel Discussion (Misc queries) 2 July 18th 08 07:35 PM
change date based on time kdp145 Excel Discussion (Misc queries) 7 December 14th 05 02:05 AM
Ignoring Time in a Date Time Calculation nmp Excel Worksheet Functions 3 November 23rd 05 08:32 PM
Creating a unique ID number based on date and time WillRn Excel Programming 3 May 4th 05 01:44 AM


All times are GMT +1. The time now is 06:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"