Time and date sequencing together.

Avalanchez

New Member
Joined
Jun 23, 2021
Messages
17
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Platform
  1. Windows
Hello,

I am trying to figure out the best way to create a time and date sequence that work together. I can get the time to work correctly with the sequence formula but Im not sure how to incorporate the date. Im trying to have one cell have date (B1) and the next the time (C1), when the rest of the rows below those see that date and time I want a 6 hour sequence to follow for the next 13 rows. Can this be done by formula or would VBA be easier?
EX:
Start Times2/20/202312:00
6 hr2/20/202318:00
12 hr2/21/202300:00
18 hr2/21/202306:00
24 hr
30 hr
36 hr
42 hr
48 hr
54 hr
60 hr
66 hr
72 hr
End
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
How about
Fluff.xlsm
ABC
1Start Times20/02/202312:00:00
220/02/202318:00:00
321/02/202300:00:00
421/02/202306:00:00
521/02/202312:00:00
621/02/202318:00:00
722/02/202300:00:00
822/02/202306:00:00
922/02/202312:00:00
1022/02/202318:00:00
1123/02/202300:00:00
1223/02/202306:00:00
1323/02/202312:00:00
1423/02/202318:00:00
15
Summary
Cell Formulas
RangeFormula
B2:C14B2=LET(a,SEQUENCE(13,,B1+C1+TIME(6,0,0),TIME(6,0,0)),HSTACK(INT(a),MOD(a,1)))
Dynamic array formulas.
 
Upvote 0
Solution
How about
Fluff.xlsm
ABC
1Start Times20/02/202312:00:00
220/02/202318:00:00
321/02/202300:00:00
421/02/202306:00:00
521/02/202312:00:00
621/02/202318:00:00
722/02/202300:00:00
822/02/202306:00:00
922/02/202312:00:00
1022/02/202318:00:00
1123/02/202300:00:00
1223/02/202306:00:00
1323/02/202312:00:00
1423/02/202318:00:00
15
Summary
Cell Formulas
RangeFormula
B2:C14B2=LET(a,SEQUENCE(13,,B1+C1+TIME(6,0,0),TIME(6,0,0)),HSTACK(INT(a),MOD(a,1)))
Dynamic array formulas.
I think that'll work thank you very much.
 
Upvote 0
How about
Fluff.xlsm
ABC
1Start Times20/02/202312:00:00
220/02/202318:00:00
321/02/202300:00:00
421/02/202306:00:00
521/02/202312:00:00
621/02/202318:00:00
722/02/202300:00:00
822/02/202306:00:00
922/02/202312:00:00
1022/02/202318:00:00
1123/02/202300:00:00
1223/02/202306:00:00
1323/02/202312:00:00
1423/02/202318:00:00
15
Summary
Cell Formulas
RangeFormula
B2:C14B2=LET(a,SEQUENCE(13,,B1+C1+TIME(6,0,0),TIME(6,0,0)),HSTACK(INT(a),MOD(a,1)))
Dynamic array formulas.
One last thing, If those top two cells are blank, can it keep the rest of the cells blank until entered?
 
Upvote 0
How about
Excel Formula:
=LET(a,SEQUENCE(13,,B1+C1+TIME(6,0,0),TIME(6,0,0)),IF(OR(B1="",C1=""),"",HSTACK(INT(a),MOD(a,1))))
 
Upvote 1
How about
Excel Formula:
=LET(a,SEQUENCE(13,,B1+C1+TIME(6,0,0),TIME(6,0,0)),IF(OR(B1="",C1=""),"",HSTACK(INT(a),MOD(a,1))))
How would This code be written for older versions of excel without the LET function?
 
Upvote 0
What older versions do you mean?
Well my work book was built on 365 but i have an old laptop with excel 2013 that the LET function isnt implemented in. I kind of tried chopping it up a little myself but just cant get it quite right.
 
Upvote 0
Upvote 0
Ok, how about
Cell Formulas
RangeFormula
B2:B14B2=INT(B1+C1+TIME(6,0,0))
C2:C14C2=MOD(B1+C1+TIME(6,0,0),1)
That was enough to get me over the hump! I appreciate it AGAIN! Thanks
 
Upvote 0

Forum statistics

Threads
1,223,622
Messages
6,173,379
Members
452,514
Latest member
cjkelly15

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