I want random numbers generated without repeating

Johncobb

New Member
Joined
Sep 7, 2006
Messages
43
Office Version
  1. 365
Platform
  1. Windows
In my worksheet in column CC in C1:C20 I want Excel to ganerate 20 random numbers between 1 and 80 without repeating the same numbers.
At present I have the following formula entered and it works, but after I click F9 some repeated numbers are generated.

=INT(RAND()*(80-1)+1)

How can I change the formula or replace it?
Thank you in advance for your help.
Ragards to all supporters.
John.
 
Hi, Fin Fang Foom,

the formula is looking to previous numbers to avoid duplicates
so you cannot nest it into another formula

use another column

(I don't think you need this complicated formula for your purpose)

kind regards,
Erik
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Thank you for the reply erik.van.geit.


I took erik suggestion and used a helper column. This is the best that I came up with.

What I did was I inputed this formula in cell C2 and copied down.

=INDEX($A$2:$A$100,IF($A$2:$A$100<>"",INT(1+26*(RAND()))))

Then I inputed this formula in cell E2 and I copied down.

=LOOKUP(REPT("z",255),CHOOSE({1,2},"",INDEX($C$2:$C$100,MATCH(0,COUNTIF($E$1:E1,$C$2:$C$100),0))))

Both formula are an-array Hold down

Ctrl,Shift,Enter

Thanks everyone. :)
Werid formulas.xls
ABCDEF
1
2agg
3bbb
4ctt
5drr
6eii
7fra
8galf
9hlf
10iz
11jb
12ku
13lfg
14mna
15nk
16ot
17pu
18qs
19rt
20s
21t
22u
23v
Sheet1
 
Upvote 0

Forum statistics

Threads
1,213,554
Messages
6,114,280
Members
448,562
Latest member
Flashbond

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