Forum Discussion
GregD230697
May 22, 2023Copper Contributor
Genrate Date and Hour : Hour by hour for day by day
Hi everyone,
I would like to know how to generate an excel file allowing me to display date and hour (dd/mm/yyyy hh:mm) for a day so 23 lignes from 00:00 to 23:00 for the 01/01/2023 to the 31/12/2028. so 8760 lines for a year.
I didn't find the answer anywhere...
Regards,
G
- OliverScheurichGold Contributor
=44927+(ROW(1:1)-ROW($1:$1))/24
In Excel 2013 you can enter this formula in row 1 and fill down.
- SnowMan55Bronze Contributor
GregD230697 Or, if you want the formula to be closer to self-documenting, you can use this:
=LET( start_of_this_period, DATE(2023, 1, 1), start_of_next_period, DATE(2029,1,1), SEQUENCE(24*(start_of_next_period - start_of_this_period),, start_of_this_period, 1/24) )
If you have Microsoft 365 or Office 2021, enter the following formula in the cell where you want to begin:
=SEQUENCE(52608, , DATE(2023, 1, 1), 1/24)
The formula will spill to 52608 rows. Select the spill range and format it as dd/mm/yyyy hh:mm