I actually realised this when I tried a few solutions, it does make sense to cap it to 60 so I've adapted that.James,
If they want to select a complete random 20 minute block from an 80 minute game, wouldn't you want the start time to be capped at 60 minutes?
If you start the random block at any point after 60 minutes, you cannot get a full, complete 20 minute block.
Thank you! This works great for what I need. I'm wondering now is there possibly a way to generate two 10-minute blocks in the same 80-mins but don't overlap?Hi & welcome to MrExcel.
How about
and format the cell as [mm]:ssExcel Formula:=RANDARRAY(1,1,TIME(0,0,0),TIME(1,20,0))
=LET(a,RANDARRAY(1,1,TIME(0,0,0),TIME(1,10,0)),b,RANDARRAY(10,1,TIME(0,0,0),TIME(1,10,0)),c,ABS(b-a),d,FILTER(b,c>10/1440),e,INDEX(d,1),f,IF(SEQUENCE(2)=1,a,e),f)
That'll do it!This is ridiculous, but there is not constraint on when the two 10-minute periods start happen, except not to overlap. They could be the first two ten minutes.
Excel Formula:=LET(a,RANDARRAY(1,1,TIME(0,0,0),TIME(1,10,0)),b,RANDARRAY(10,1,TIME(0,0,0),TIME(1,10,0)),c,ABS(b-a),d,FILTER(b,c>10/1440),e,INDEX(d,1),f,IF(SEQUENCE(2)=1,a,e),f)