change the time in now()

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,565
Hi
I want to generate different date and time to fill a column with different data. So I entered the formula below and then autofill the column. I ended up with different date but same time!! how can I change the time? thank you.

=now() - randbetween(0,1000)
 

Some videos you may like

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.

OGCV1

New Member
Joined
Nov 12, 2017
Messages
36
Hi
I want to generate different date and time to fill a column with different data. So I entered the formula below and then autofill the column. I ended up with different date but same time!! how can I change the time? thank you.

=now() - randbetween(0,1000)

Try adding -rand() to the end to become:

=now() - randbetween(0,1000) - rand()

The time is effectively a decimal on the end of the number (the number being the date)
 

Watch MrExcel Video

Forum statistics

Threads
1,109,142
Messages
5,527,069
Members
409,742
Latest member
setam

This Week's Hot Topics

Top