Forum Discussion

GregD230697's avatar
GregD230697
Copper Contributor
May 22, 2023

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

  • SnowMan55's avatar
    SnowMan55
    Bronze 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)
    )

     

  • GregD230697 

    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

Resources