Auto-generate date and time for a large period.

Bilingual

Board Regular
Joined
Oct 1, 2010
Messages
186
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi, its probably a very simple question, but i want to generate to following values in the two columns:

DateTime
01-11-20161
01-11-20162
01-11-20163
01-11-20164
01-11-20165
01-11-20166
01-11-20167
01-11-20168
01-11-20169
01-11-201610
01-11-201611
01-11-201612
01-11-201613
01-11-201614
01-11-201615
01-11-201616
01-11-201617
01-11-201618
01-11-201619
01-11-201620
01-11-201621
01-11-201622
01-11-201623
01-11-201624
02-11-20161
etcetc

<tbody>
</tbody>

How do it without doing it manually? :)
 
Last edited:

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
I might have written it too complicated, the only thing i want is a new datecolumn to add 1 to the date for every 24 row.
 
Upvote 0
Enter one date manually in A2, then

A​
B​
C​
2​
1/11/2016​
1​
B2: =HOUR(A2)+1
3​
1/11/2016​
2​
A3: =MROUND(A2 + "1:00", "1:00")
4​
1/11/2016​
3​
5​
1/11/2016​
4​
6​
1/11/2016​
5​
7​
1/11/2016​
6​
8​
1/11/2016​
7​
9​
1/11/2016​
8​
10​
1/11/2016​
9​
11​
1/11/2016​
10​
12​
1/11/2016​
11​
13​
1/11/2016​
12​
14​
1/11/2016​
13​
15​
1/11/2016​
14​
16​
1/11/2016​
15​
17​
1/11/2016​
16​
18​
1/11/2016​
17​
19​
1/11/2016​
18​
20​
1/11/2016​
19​
21​
1/11/2016​
20​
22​
1/11/2016​
21​
23​
1/11/2016​
22​
24​
1/11/2016​
23​
25​
1/11/2016​
24​
26​
1/12/2016​
1​
27​
1/12/2016​
2​
28​
1/12/2016​
3​
 
Upvote 0
Here's a possibility. It depends on what you think "manual" is.

1. Start in cell A1. Enter your start date including hours and minutes; e.g., 2018-10-17 00:00.
2. Enter the following formula into A2: = A1 + 1/24. This should result with A2 showing the following value: 2018-10-17 01:00. It has been incremented by one hour since an hour is 1/24 of a day.
3. Drag the formula down to fill cells A3, A4, etc. Drag it as far as you need to to generate all the dates and hours that you need.
4. This may already bee accomplishing what you really need. But if you truly need to have the dates and times split into two columns then create formulas in cells B1 and C1 that accomplish this. I.e., in B1 use =DATE(YEAR(A1), MONTH(A1), DAY(A1)) and in C1 use = HOUR(A1).
5. Drag these formulas down as far as you need.
6. If you want the values rather than the formulas then copy and paste as values.
7. Of course, start in any cell that you want.

I hope this helps.
 
Last edited:
Upvote 0
Hi Dan, thanks for tries, i ended up solving it with a combination your advice and of INT,CEILING and MOD
=INT(A1)+CEILING(MOD($A1;1);1/24)
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,924
Members
448,533
Latest member
thietbibeboiwasaco

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