something better than rand

bademployee

Board Regular
Joined
Aug 19, 2010
Messages
184
I'm looking for a better option than below to come up with 3 digit contract numbers

=INT(1000*RAND())

Ideally I'd like a value returned from a range when a button is hit, each value returned would then be crossed off the list/disabled, so it could not be returned twice.

Possible?

Thanks for any help in advance.

Mark
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
If you have a list of existing three digit numbers including 0 and 1000, sort them and put them into column A of the spreadsheet you'll be using. Then use the following two formulas:
Excel Workbook
ABCD
1000*posnum
2041*8594
3155***
4207***
5261***
6337***
7339***
8427***
9632***
10804***
11809***
121000***
Sheet


This might be difficult to manage, though.

EDIT: Bah, I assumed you needed them to be non-sequential.
 
Last edited:
Upvote 0
If you are not restricted I would use 7 digits and have it as year and then contract, e.g. first would be 2011001, then 2011002 etc

This does not need to be generated but can simply be generated as next value from a list. You could code in VBA to automatically assign.
 
Upvote 0
If it's easiest I would just maintain a list of used which would start at 2011001 and then if that was say cell A1 then A2 would be =A1+1

Hope this solves but could code if required.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

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