IF statement or MACRO? Time series math help

Benny3

New Member
Joined
Aug 4, 2015
Messages
5
Hi,

I have a time series data set (see table below for example) where I need to add up a column (F:kWh_calc) for just one days worth of data. The data set is years worth of electrical demand interval data and its all at random time stamp intervals that average about every 15 minutes for a recording.

My previous data sets where exact time intervals where I could just use a function to look at the time stamp, and if there was a difference in the 'days,' the function would simply add up the previous 96 rows of data. (96 rows on exactly 15 minute intervals = 1 days data) Ultimately I would then use the filter function in excel to create to create a set of data of the F:kWh_calc. (kilowatts of electricity consumed in one day)

Would anyone know how I can improve this function where I could add up values in a column for just one days worth of data regardless if the time stamps are at different intervals? Columns labeled Month, Weekday, Year, Hour, and Weeknumber are just simple Excel functions to return a value based on Column A:Time.

This function however based on adding up the 96 cells wont work, would anyone know how make it better? Ideally if I was really good at writing code I could create a macro to output the data I want on a separate tab with time stamp for the date of total kWh_calc per day.

=IF(H2<>H3,SUM(F2:F97),"")


ABCDEFGHIJKL
1timeOATkWMinutes_calcHOUR_calckWh_calcMonthWeedayYearHourWeeknumberHoliday
2
6/17/2016 5:00

<tbody>
</tbody>
59.9

<tbody>
</tbody>
31

<tbody>
</tbody>
15.257.756620165251
3
6/17/2016 5:15

<tbody>
</tbody>
59.9

<tbody>
</tbody>
29.2

<tbody>
</tbody>
15.257.36620165251
4
6/17/2016 5:30

<tbody>
</tbody>
59.9

<tbody>
</tbody>
28.8
5.08332.46620165251
5
6/17/2016 5:35

<tbody>
</tbody>
59.2

<tbody>
</tbody>
28.810.16674.86620165251
6
6/17/2016 5:45

<tbody>
</tbody>
59.2

<tbody>
</tbody>
29.810.16674.9676620165251
7
6/17/2016 5:55

<tbody>
</tbody>
59.7

<tbody>
</tbody>
28.85.08332.4836620165251
8
6/17/2016 6:00

<tbody>
</tbody>
59.7

<tbody>
</tbody>
28.415.257.26620165251
9
6/17/2016 6:15

<tbody>
</tbody>
58.6

<tbody>
</tbody>
28.415.257.16620165251

<tbody>
</tbody>

Thank you for your time-!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,214,950
Messages
6,122,428
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top