How to generate fixed length of random numbers ?

navinrb

Board Regular
Joined
Jun 9, 2020
Messages
82
Office Version
  1. 2019
Platform
  1. Windows
  2. Mobile
  3. Web
Please help to generate random numbers between 0 -9 with fixed length of 10 digits .
I applied randbetween (0^10,9^10) but its generating some nine or eight digits also....
Thanks in advance .
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Not sure what you're referring to there, random numbers between 0 and 9 will be 1 digit, not 10. 0^10 is still 0, 9^10 is 3486784401

Perhaps
Excel Formula:
=RANDBETWEEN(1e+9,1e+10-1)
if that fails then you would need to provide a more logical explanation.
 
Upvote 0
Not sure what you're referring to there, random numbers between 0 and 9 will be 1 digit, not 10. 0^10 is still 0, 9^10 is 3486784401

Perhaps
Excel Formula:
=RANDBETWEEN(1e+9,1e+10-1)
if that fails then you would need to provide a more logical explanation.
I want to generate random number between 0 to 9 but must be fixed 10 digit length.
 
Upvote 0
As I already said, numbers between 1 and 9 are 1 digit, not 10.

If my suggested formula is not what you need then you will need provide more (clearer) information. Simply repeating what you already said does not make it any clearer.
 
Upvote 0
As I already said, numbers between 1 and 9 are 1 digit, not 10.

If my suggested formula is not what you need then you will need provide more (clearer) information. Simply repeating what you already said does not make it any clearer.
I am refering length of number as 10 not dighit 10 . Len(a1) =10 ...
 
Upvote 0
like this? =BASE(RANDBETWEEN(0,9),10,10)
or repeat ten times =RANDBETWEEN(0,9)&RANDBETWEEN(0,9)&.... and so on
 
Upvote 0
Please refer to the second line of post 4. I assume that you have tried the formula that I suggested?
 
Upvote 0
Please refer to the second line of post 4. I assume that you have tried the formula that I suggested?
Yeah thanks its working but what if i want zero before some numbers.
 
Upvote 0
like this? =BASE(RANDBETWEEN(0,9),10,10)
or repeat ten times =RANDBETWEEN(0,9)&RANDBETWEEN(0,9)&.... and so on
Tried yours but its repeating only 1 digit ten times ..i m trying to generate random numbers with fixed length of 10. Like mobile numbers .
 
Upvote 0
Then you need to use 0 as the lower limit for the formula and apply a custom format to the cell so show 10 digits.
Like mobile numbers .
So that you can spam people with unsolicited marketing calls? ?
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,685
Members
448,977
Latest member
dbonilla0331

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