Calculate time intervals in minutes of sequential data

rdupree

New Member
Joined
Dec 15, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Ok so I need help calculating time interval data that is sequential in nature. To preface, this time data has already been filtered on a variable that isn't shown and I don't believe is necessary for this exercise. You will notice from my color shading where the time intervals break and pick back up.

I have several thousand rows of time stamped data, and I need to calculate the time interval (in minutes) over each and every interval of time. I've shown an example below to illustrate.
Column 1 = Date
Column 2 = Time (color shaded)
Column 3 = Time Interval in Minutes (done by hand for show)
The time stamps are consistently on a 15 min interval.

Is there a formula or function that I can use in excel to recognize the sequence, count the "chunks" of time in column 2, and put it in column 3?

Any help would be appreciated. If you need any further information, please feel free to ask.

Thank you in advance.

1639607071390.png
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
You can do it using functions with a few "helper" columns. I have put these in columns C to F you can easily move them:
In C2:

=(B2-B1)>TIMEVALUE("00:15:00")

In D2

=B2-B1

In E2

=IF(C2,TIMEVALUE("00:15:00"),E1+D2)

In F2

=IF(C3,E2,"")

Then copy them all down
 
Upvote 0
You can do it using functions with a few "helper" columns. I have put these in columns C to F you can easily move them:
In C2:

=(B2-B1)>TIMEVALUE("00:15:00")

In D2

=B2-B1

In E2

=IF(C2,TIMEVALUE("00:15:00"),E1+D2)

In F2

=IF(C3,E2,"")

Then copy them all down


Thank you for the suggestion. So I plugged in the functions as suggested and below is what I am getting returned in the calculated cells. This has been a big part of the issue I have had in dealing with adding up time intervals, as opposed to just numerical values. Is there a different function I can use or am I plugging something in wrong?

Assuming first column is "A", second column is "B", and so on...

Thank you again.



11/30/2020​
3:45:00
FALSE​
-1​
-1​
11/30/2020​
4:00:00
FALSE​
0​
-1​
11/30/2020​
4:15:00
FALSE​
0​
-1​
11/30/2020​
4:30:00
FALSE​
0​
-1​
-1​
12/11/2020​
7:15:00
TRUE​
0​
0​
0​
1/25/2021​
13:00:00
TRUE​
0​
0​
1/25/2021​
13:15:00
FALSE​
0​
0​
1/25/2021​
13:30:00
FALSE​
0​
0​
0​
1/25/2021​
14:00:00
TRUE​
0​
0​
1/25/2021​
14:15:00
FALSE​
0​
0​
1/25/2021​
14:30:00
FALSE​
0​
0​
1/25/2021​
14:45:00
FALSE​
0​
0​
1/25/2021​
15:00:00
FALSE​
0​
0​
1/25/2021​
15:15:00
FALSE​
0​
0​
0​
2/19/2021​
17:00:00
TRUE​
0​
0​
2/19/2021​
17:15:00
FALSE​
0​
0​
0​
2/24/2021​
20:15:00
TRUE​
0​
0​
2/24/2021​
20:30:00
FALSE​
0​
0​
2/24/2021​
20:45:00
FALSE​
0​
0​
2/24/2021​
21:00:00
FALSE​
0​
0​
2/24/2021​
21:15:00
FALSE​
0​
0​
2/24/2021​
21:30:00
FALSE​
0​
0​
2/24/2021​
21:45:00
FALSE​
0​
0​
0​
2/24/2021​
23:45:00
TRUE​
0​
0​
2/24/2021​
0:00:00
FALSE​
-1​
-1​
2/25/2021​
0:15:00
FALSE​
0​
-1​
2/25/2021​
0:30:00
FALSE​
0​
-1​
2/25/2021​
0:45:00
FALSE​
0​
-1​
2/25/2021​
1:00:00
FALSE​
0​
-1​
2/25/2021​
1:15:00
FALSE​
0​
-1​
-1​
 
Upvote 0
You need to format the columns as "time". Another possibility is that column B
might be text not a time value, if this is the case you need to convert it to timevalue
 
Upvote 0
You need to format the columns as "time". Another possibility is that column B
might be text not a time value, if this is the case you need to convert it to timevalue
I did check the formatting of that column, and column B is definitely formatted as "time". Is there anything else obvious I may be missing?

Thanks again

RD
 
Upvote 0
Considering your data sample in post #3 (see below), could you fill column C with the expected/desired results?

Pasta1
ABC
1DateTimeExpected results
211/30/202003:45:00
311/30/202004:00:00
411/30/202004:15:00
511/30/202004:30:00
612/11/202007:15:00
701/25/202113:00:00
801/25/202113:15:00
901/25/202113:30:00
1001/25/202114:00:00
1101/25/202114:15:00
1201/25/202114:30:00
1301/25/202114:45:00
1401/25/202115:00:00
1501/25/202115:15:00
1602/19/202117:00:00
1702/19/202117:15:00
1802/24/202120:15:00
1902/24/202120:30:00
2002/24/202120:45:00
2102/24/202121:00:00
2202/24/202121:15:00
2302/24/202121:30:00
2402/24/202121:45:00
2502/24/202123:45:00
2602/24/202100:00:00
2702/25/202100:15:00
2802/25/202100:30:00
2902/25/202100:45:00
3002/25/202101:00:00
3102/25/202101:15:00
Plan6


M.
 
Upvote 0
Given Marcelo has kindly typed all the data into XL2BB I thought I would try it with my equations from post two. I got error because the values in row 1 were not numbers, this was sovled by typing FALSE into C2 and zero in D2 after copying the equations down , then formatting colemns D and E as time. So I sugest you compare your data to the Data that marcelo has typed in to see what the difference is.
PS Please use XL2BB to upload your data then it makes it much easier to help you
 
Upvote 0
Thank you for the tip. Here is a sample of the spreadsheet from XL2BB. As a note, in Column C, the summed time values in minutes are hand typed to use for an example.

Thank you again for the help.


2021 Mabank Interval Data_5MW and above Calcs.xlsx
DEF
55258/10/20210:15:0015
55268/10/20212:45:00
55278/10/20213:00:00
55288/10/20213:15:00
55298/10/20213:30:00
55308/10/20213:45:00
55318/10/20214:00:00
55328/10/20214:15:0090
55338/10/20217:00:00
55348/10/20217:15:00
55358/10/20217:30:00
55368/10/20217:45:00
55378/10/20218:00:00
55388/10/20218:15:00
55398/10/20218:30:00
55408/10/20218:45:00
55418/10/20219:00:00120
55428/10/20219:45:0015
55438/10/202111:00:00
55448/10/202111:15:00
55458/10/202111:30:00
55468/10/202111:45:00
55478/10/202112:00:00
55488/10/202112:15:00
55498/10/202112:30:00
55508/10/202112:45:00
55518/10/202113:00:00
55528/10/202113:15:00135
55538/10/202114:00:00
55548/10/202114:15:00
55558/10/202114:30:0030
KW >5000 FILTERED
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E:EOther TypeColor scaleNO
 
Upvote 0
Maybe something like this (in my example below data begin in A2 - adjust the formula)

21122021 Testes.xlsx
ABC
1DateTimeResult
208/10/202100:15:0015
308/10/202102:45:00 
408/10/202103:00:00 
508/10/202103:15:00 
608/10/202103:30:00 
708/10/202103:45:00 
808/10/202104:00:00 
908/10/202104:15:0090
1008/10/202107:00:00 
1108/10/202107:15:00 
1208/10/202107:30:00 
1308/10/202107:45:00 
1408/10/202108:00:00 
1508/10/202108:15:00 
1608/10/202108:30:00 
1708/10/202108:45:00 
1808/10/202109:00:00120
1908/10/202109:45:0045
2008/10/202111:00:00 
2108/10/202111:15:00 
2208/10/202111:30:00 
2308/10/202111:45:00 
2408/10/202112:00:00 
2508/10/202112:15:00 
2608/10/202112:30:00 
2708/10/202112:45:00 
2808/10/202113:00:00 
2908/10/202113:15:00135
3008/10/202114:00:00 
3108/10/202114:15:00 
3208/10/202114:30:0030
Plan10
Cell Formulas
RangeFormula
C2:C32C2=IF(ROUND(MOD(B3-B2,1)*1440,0)<>15,IF(OR(ISNUMBER(C1),ROWS(C$2:C2)=1),MINUTE(B2),MOD(B2-INDEX(B$2:B2,IFERROR(MATCH(9.99E+307,C$1:C1),1)),1)*1440),"")


M.
 
Upvote 0
Firstly your manual calculations are inconsistent. line 5532 you show a sum of 90 when there are 7 15 minute intervals , while on line 5542 you show 15 after only 1 interval, you can't have it both ways.!!
very simlar to my original equations:
in F3:
=(E3-E2)>TIMEVALUE("00:16:00")
in G3
=E3-E2
in H3
=IF(F3,TIMEVALUE("00:15:00"),H2+G3)
in i3
=IF(F4,24*60*H3,"")
Column I is formatted as a number NOT time
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,916
Members
449,093
Latest member
dbomb1414

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