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.
One way...
A2: 1
A3, copied down:
=LOOKUP(9.99999999999999E+307,$A$2:A2)
ADVERTISEMENT
Not like you to make a mistake. You must be having an off day. {grin}
The formula as posted simply yields 1. LOOKUP(...)+1 might be what you meant. Though, MAX($A$2:A2)+1 might be safer.
ADVERTISEMENT
Hi Aladin.
You are the most fantastic formula guru and you have helped me in the past, for which I thank you very much.
However, your formula just generates 1s for me - Excel 2003 and Windows XP.
That was not my intent. My apology if that's the interpretation that came across.{snip}
You seem to enjoy the occasion.
I have no clue what OpenOffice has to do with anything. But, a '+1' term is needed to generate unique numbers as I noted in my post; and, in any case, MAX()+1 is safer.It's a valid formula even in OpenOffice (Version 2.0).
generate a random and unique number for each row in my worksheet. Is there a formula to do this in Excel?