Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 47
Default Create 5 of 6 digits randomly.

I would like to create a random conformation number, but only make the last 5
of 6 digits random. I would like to make the first number be the hour witch
the meeting time will start. For ex. (743856) 7 for 7:00 and the other 5
would be random. Any help would be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 293
Default Create 5 of 6 digits randomly.

Hi Shaun,

Perhaps:
=A1&TEXT(INT(RAND()*10^5),"00000")
where A1 contains the fixed value. If you need the result as a number, you could use:
=VALUE(A1&TEXT(INT(RAND()*10^5),"00000"))

--
Cheers
macropod
[MVP - Microsoft Word]


"Shaun" wrote in message ...
I would like to create a random conformation number, but only make the last 5
of 6 digits random. I would like to make the first number be the hour witch
the meeting time will start. For ex. (743856) 7 for 7:00 and the other 5
would be random. Any help would be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 100
Default Create 5 of 6 digits randomly.

Hi Shaun,

Simplifying macropods answer slightly, you can use

=--(A1&INT(RAND()*10^5))

to give you the result you need. The double negative coerces the result of
the concatenation into a number.

Dave

url:http://www.ureader.com/msg/10356918.aspx
  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 293
Default Create 5 of 6 digits randomly.

Hi Dave,

Unfortunately, that approach drops the leading 0s from the value returned by the RAND function. You could use:
=--(A1&TEXT(INT(RAND()*10^5),"00000"))

--
Cheers
macropod
[MVP - Microsoft Word]


"Dave Curtis" wrote in message .. .
Hi Shaun,

Simplifying macropods answer slightly, you can use

=--(A1&INT(RAND()*10^5))

to give you the result you need. The double negative coerces the result of
the concatenation into a number.

Dave

url:http://www.ureader.com/msg/10356918.aspx

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard to do? randomly farmer Excel Worksheet Functions 3 March 27th 08 12:06 PM
How to customize number to 10 digits including 2 digits after deci Carina Excel Worksheet Functions 3 September 20th 07 02:50 AM
how do I create a Date field format for mm/dd/yyyy (10 digits) The Big Kahuna Excel Worksheet Functions 1 October 26th 06 05:32 PM
randomly selection Shea Excel Discussion (Misc queries) 1 April 4th 06 04:49 AM
how do i create a spread sheet with randomly placed numbers 1-500. sarasota Excel Discussion (Misc queries) 1 January 25th 06 04:52 PM


All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"