Unique Random Number

JontyHart

New Member
Joined
Aug 23, 2006
Messages
6
In column A, I want to generate a random and unique number for each row in my worksheet. Is there a formula to do this in Excel? In MS Access, I would have achieved this through use of a Primary Key.
 
generate a random and unique number for each row in my worksheet. Is there a formula to do this in Excel?

Has anybody noticed the random and unique part of the OP's request?
Why quote the OP selectively? The rest of the post
In MS Access, I would have achieved this through use of a Primary Key.

Nonetheless, if one truly wants random unique numbers...
Random Selection
http://www.tushar-mehta.com/excel/newsgroups/rand_selection/index.html
 
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
tushar

I don't see how the OP would achieve this in Access using a primary key.

For a start in Access a primary key doesn't need to be a number.

Now if they meant an Autonumber field then that is a number, it's data type is Long Integer and you can set it's New Values property to Random or Increment.

So every time a new record is added a new random number or the next number in the sequence is put in the field.

A field of this type is commonly used in Access as a primary key.
 
Upvote 0
My apologies if I wasn't clear from the start. Perhaps it isn't as necessary that the number be random, as it is to be unique. I need the ability to create unique numbers in my column, however, they need to be static numbers once generated. The Row() formula would change if the row sequence were to be updated later.

I'm not very technical, so have achieved this by creating a macro that inserts todays date, multiplies that date value by 5, rounds to 100,000, then copies and pastes the result as a value. It results in 10 digit unique and static numbers. The result is the calculated date and time to the second, rounded. It's a bit cumbersome, so I was hoping their was an easier way. I don't need the resultant number to be so many digits either, but it seemed the only way that I could get the number to be unique.
 
Upvote 0

Forum statistics

Threads
1,214,947
Messages
6,122,411
Members
449,081
Latest member
JAMES KECULAH

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