1

I need to crate a list of 60 random dates between 01/01/1949 to 01/01/2004.

Steps I took:

  1. formatted the column as format -> number -> date -> mm/dd/yyyy.

2.used this formula in cell: =RANDBETWEEN(1/1949,1/1/2004) and got #NUM! error:

What am I missing here?

danb2000
  • 19
  • 3

4 Answers4

1

Another option generating array:

=ArrayFormula(DATE(1949,1,1)+RANDARRAY(60,1)*DATEDIF(DATE(1949,1,1),DATE(2004,1,1),"D"))

enter image description here

basic
  • 11,673
  • 2
  • 9
  • 26
0

It appears that the values passed to RANDBETWEEN should be integers.

You can use this expression to generate the required random dates:

=date(1949,1,1)+randbetween(0,date(2004,1,1)-date(1949,1,1))

raghu
  • 406
  • 2
  • 3
0

There are 20088 days between your date range:

=datedif(datevalue("1/1/1949"),datevalue("1/1/2004"),"D")

or =datevalue("1/1/2004")-datevalue("1/1/1949")

Therefore try this to get a sequential list of random dates:

=arrayformula(query(datevalue("1/1/1949")+int(RANDARRAY(60,1)*20088),"order by Col1",0))

enter image description here

Aresvik
  • 4,484
  • 1
  • 5
  • 18
0

OK - FYI, It tried out this syntax and it works like a charm:

=RANDBETWEEN(DATE(1949, 1, 1),(DATE(2004,1,1)))

Many thanks for all those who suggested their answers above

danb2000
  • 19
  • 3