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

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.
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,223,912
Messages
6,175,340
Members
452,638
Latest member
Oluwabukunmi

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