Preskoči na glavno vsebino

Kako ustvariti naključno številko brez dvojnikov v Excelu?

V mnogih primerih boste morda želeli v Excelu ustvariti naključne številke? Toda pri splošnih formulah za naključno izbiranje števil lahko obstajajo podvojene vrednosti. Tukaj vam bom povedal nekaj trikov za ustvarjanje naključnih števil brez dvojnikov v Excelu.

Ustvari edinstvene naključne številke s formulami

Ustvari edinstveno naključno številko s programom Kutools for Excel's Insert Random Data (enostavno!) dobra ideja3


puščica modri desni mehurček Ustvari edinstvene naključne številke s formulami

Če želite v Excelu ustvariti edinstvene naključne številke, morate uporabiti dve formuli.

1. Recimo, da morate v stolpec A in stolpec B ustvariti naključne številke brez dvojnikov, zdaj izberite celico E1 in vnesite to formulo = RAND (), Nato pritisnite Vnesite tipko, glej posnetek zaslona:
doc-randomize-no-repeat-1

2. In s pritiskom na izberite celoten stolpec E Ctrl + Vesolje tipke hkrati in pritisnite Ctrl + D tipke za uporabo formule = RAND () na celoten stolpec E. Oglejte si posnetek zaslona:
doc-randomize-no-repeat-2

3. Nato v celico D1 vnesite največje število želenega naključnega števila. V tem primeru želim vstaviti naključne številke brez ponavljanja med 1 in 50, zato bom vtipkal 50 v D1.
doc-randomize-no-repeat-3

4. Zdaj pojdite na stolpec A, izberite celico A1, vnesite to formulo =IF(ROW()-ROW(A$1)+1>$D$1/2,"",RANK(OFFSET($E$1,ROW()-ROW(A$1)+(COLUMN()-COLUMN($A1))*($D$1/2),),$E$1:INDEX($E$1:$E$1000,$D$1))), nato povlecite ročico za polnjenje v naslednji stolpec B in povlecite navzdol do želenega obsega. Oglejte si posnetek zaslona:
doc-randomize-no-repeat-4

Zdaj se v tem območju naključne številke, ki jih potrebujete, ne ponavljajo.

Opomba:

1. V zgornji dolgi formuli A1 označuje celico, ki jo uporabljate dolgo formulo, D1 označuje največje število naključnega števila, E1 je prva celica stolpca, ki jo uporabite formula = RAND (), in 2 pomeni, da jo želite vstaviti naključno število v dva stolpca. Lahko jih spremenite po svoji potrebi.

2. Ko se v obseg generirajo vse enolične številke, bodo odvečne celice prikazane prazne.

3. S to metodo lahko ustvarite naključno število, ki se začne od številke 1. Toda z drugim načinom lahko enostavno določite obseg naključnih števil.


puščica modri desni mehurček Ustvari edinstveno naključno število s programom Kutools for Excel's Insert Random Data

Z zgornjimi formulami je preveč neprijetnosti. Ampak s Kutools za ExcelJe Vstavite naključne podatke funkcijo lahko hitro in enostavno vstavite edinstvene naključne številke po svoji potrebi, kar prihrani veliko časa.

Manj časa, a večja produktivnost

Vključuje 300+ profesionalnih orodij za Excel 2019-2003
Prva različica 1.0 je bila izdana leta 2011, zdaj je različica 18.0
V nekaj sekundah reši večino dnevnih zapletenih nalog programa Excel in prihranite čas
30-dnevno brezplačno preskusno obdobje brez kakršnih koli omejitev

kte 包装 盒

Po namestitvi Kutools za Excel, naredite spodaj:(Brezplačno prenesite Kutools za Excel zdaj!)

1. Izberite obseg, ki ga potrebujete za ustvarjanje naključnih števil, in kliknite Kutools > Vstavi > Vstavite naključne podatke. Oglejte si posnetek zaslona:

2. V Ljubljani Vstavite naključne podatke dialog, pojdite na Integer v zavihek vnesite želeno število od in Da besedilna polja in ne pozabite preveriti Edinstvene vrednote možnost. Oglejte si posnetek zaslona:

3. klik Ok da ustvarite naključne številke in zaprete pogovorno okno.

Opomba:Če je v izbranih celicah več kot naključnih števil, so odvečne celice prazne.

Vstavite lahko tudi naključni enolični datum, naključni unikatni čas do Vstavite naključne podatke. Če želite imeti brezplačno preskusno različico Vstavite naključne podatke, prosim, naložite ga zdaj!
vstavite naključne podatke

Nasvet.Če želite podatke naključno izbrati ali razvrstiti, poskusite uporabiti Kutools za Excel Razvrsti obseg naključno kot je prikazano na naslednjem posnetku zaslona. Popolnoma deluje brez omejitev v 30 dneh, prosim prenesite in si zagotovite brezplačno preskusno različico zdaj

doc izberite naključno


puščica modri desni mehurček Vstavite naključne podatke brez dvojnika




Hitro vstavite več potrditvenih polj ali gumbov v vrsto celic na delovnem listu

V Excelu lahko enkrat v celico vstavite samo eno potrditveno polje / gumb, težavno pa bo, če je treba hkrati vstaviti več potrditvenih polj / gumbov. Kutools za Excel ima močan pripomoček - Preverjanje vstavitve serije Škatle / Gumbi za paketno vstavljanje lahko z enim klikom v izbrane celice vstavi potrditvena polja / gumbe.  Kliknite za brezplačno preskusno različico vseh funkcij v 30 dneh!
doc vstavi potrditveno polje možnost gumb
 
Kutools za Excel: z več kot 300 priročnimi dodatki za Excel lahko brezplačno preizkusite brez omejitev v 30 dneh.

Najboljša pisarniška orodja za produktivnost

🤖 Kutools AI Aide: Revolucionirajte analizo podatkov na podlagi: Inteligentna izvedba   |  Ustvari kodo  |  Ustvarite formule po meri  |  Analizirajte podatke in ustvarite grafikone  |  Prikličite funkcije Kutools...
Priljubljene funkcije: Poiščite, označite ali identificirajte dvojnike   |  Izbriši prazne vrstice   |  Združite stolpce ali celice brez izgube podatkov   |   Krog brez formule ...
Super iskanje: Več kriterijev VLookup    Multiple Value VLookup  |   VLookup na več listih   |   Nejasno iskanje ....
Napredni spustni seznam: Hitro ustvarite spustni seznam   |  Odvisni spustni seznam   |  Večkrat izberite spustni seznam ....
Upravitelj stolpcev: Dodajte določeno število stolpcev  |  Premakni stolpce  |  Preklop stanja vidnosti skritih stolpcev  |  Primerjaj obsege in stolpce ...
Predstavljene funkcije: Mrežni fokus   |  Pogled oblikovanja   |   Velika vrstica formule    Upravitelj delovnih zvezkov in listov   |  Knjižnica virov (Samodejno besedilo)   |  Izbirnik datuma   |  Združite delovne liste   |  Šifriranje/dešifriranje celic    Pošljite e-pošto po seznamu   |  Super filter   |   Poseben filter (filter krepko/ležeče/prečrtano ...) ...
15 najboljših kompletov orodij12 Besedilo Orodja (dodajanje besedila, Odstrani znake,...)   |   50 + Graf Vrste (Gantt Chart,...)   |   40+ Praktično Formule (Izračunajte starost glede na rojstni dan,...)   |   19 vstavljanje Orodja (Vstavite kodo QR, Vstavi sliko s poti,...)   |   12 Pretvorba Orodja (Številke v besede, Pretvorba valut,...)   |   7 Spoji in razdeli Orodja (Napredne kombinirane vrstice, Razdeljene celice,...)   |   ... in več

Napolnite svoje Excelove spretnosti s Kutools za Excel in izkusite učinkovitost kot še nikoli prej. Kutools za Excel ponuja več kot 300 naprednih funkcij za povečanje produktivnosti in prihranek časa.  Kliknite tukaj, če želite pridobiti funkcijo, ki jo najbolj potrebujete...

Opis


Kartica Office prinaša vmesnik z zavihki v Office in poenostavi vaše delo

  • Omogočite urejanje in branje z zavihki v Wordu, Excelu, PowerPointu, Publisher, Access, Visio in Project.
  • Odprite in ustvarite več dokumentov v novih zavihkih istega okna in ne v novih oknih.
  • Poveča vašo produktivnost za 50%in vsak dan zmanjša na stotine klikov miške za vas!
Comments (17)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
En la parte Genere números aleatorios únicos con fórmulas como hago para ampliar el numero de columnas pasar de 2 a 5 sin repetir los numeros segun la formula que ud puso: =IF(ROW()-ROW(A$1)+1>$D$1/2,"",RANK(OFFSET($E$1,ROW()-ROW(A$1)+(COLUMN()-COLUMN($A1))*($D$1/2),),$E$1:INDEX($E$1:$E$1000,$D$1)))
This comment was minimized by the moderator on the site
Hello. I just found this site, and am trying to figure out best way to assign a new code to people. I'd like to assign a random code for people to use between 1000 and 65000, that does not equal any codes already assigned. I'd also like it to be formatted with 5 numbers (00000), but that's not a big deal if it doesn't take care of that. Any ideas on how to make this work? TIA :-)
This comment was minimized by the moderator on the site
Hi, Janel, why you donot try the Data Validation in Excel? It can only allow whole numbers between 1000 and 65000 to be entered in a cell range.
This comment was minimized by the moderator on the site
Help anyone :-) This one I cannot figure out. At our school we often put together students in groups - 2 and 2 together for a number of working sessions. 9 in this case. There are 18 students (vary) in the class. What I am chasing is a formula that gives me a random result of who should work together in the 9 working sessions without having students meeting each other twice. So I need Excel to give me a result of 18 students spread across 9 working sessions and any student must not be match with another student twice. How the xxxx do I fix that? I have search all over the place for inspiration without luck. Any input is appreciated :-)
This comment was minimized by the moderator on the site
Hi, Anders, you need to list all names in column A, then in column B, apply formula =rand(), then specify 2 as the size in cell F2, now apply this formula =ROUNDUP(RANK(B3,$B$3:$B$19)/$F$2,0) in column C as below screenshot shown
This comment was minimized by the moderator on the site
Hi. Thanks for your reply.
I understand you suggestions, but how do I achieve a setup where all students are assigned to maksimum number of workshops where 2 students are randomly assigned to first one workshop, then the second workshop, then the third workshop etc. etc. and to take this even further a student must not be matched with another student that he/she already have worked with. So when having 18 students I need "the system" to allocate all student to (in this case) 9 workshop (e.g. one workshop per week) and no student should be a student they have already worked with.
This comment was minimized by the moderator on the site
Hi there, did you ever manage to work out a solution to this, I've encountered the same issue. Any help would be appreciated.
This comment was minimized by the moderator on the site
Or you could use a sudoku setup.
This comment was minimized by the moderator on the site
How can I do the same thing with a custom list? Not numbers?
This comment was minimized by the moderator on the site
Your custom list is in Column A. Lets say it has 100 values and it is located in A1:A100

Column B is a counter:
1 for B1 and (B1+1) for B2:B100

Column C is a random list:
RAND() for C1:C100

Column D is a random rank based on the random list:
RANK.EQ(C1;$C$1:$C$100)

Column E is your output:
INDEX($A$1:$A$100;MATCH(D1;$B$1:$B$100;0))

Note: There is virtually no chance of generating a duplicate value on column C since RAND() have billions of possibilities. But, if you really want to erase that chance you can type the following formula at column D2:D100
IF(COUNTIFS($C$2:C2;C2)>0;D1+1;RANK.EQ(C2;$C$1:$C$100))
This comment was minimized by the moderator on the site
I need to create 5000 random numbers 1-90 no duplicates 30 columes I and using the formula =RAND() and =IF(ROW()-ROW(A$1)+1>$D$1/2,"",RANK(OFFSET($E$1,ROW()-ROW(A$1)+(COLUMN()-COLUMN($A1))*($D$1/2),),$E$1:INDEX($E$1:$E$1000,$D$1))) is there way that i could change the formula to extract the 5000 numbers
This comment was minimized by the moderator on the site
Sorry I have no idea, you can place this problem to our forum https://www.extendoffice.com/forum.html, maybe someone can help you.
This comment was minimized by the moderator on the site
After about three hours of trying to completely understand the long complicated formula to generate random numbers without duplicates, I figured out a far simpler formula that has the same results. After you randomly generate the numbers in a column using the RAND() function, You can simplify the formula:=IF(ROW()-ROW(A$1)+1>$D$1/2,"",RANK(OFFSET($E$1,ROW()-ROW(A$1)+(COLUMN()-COLUMN($A1))*($D$1/2),),$E$1:INDEX($E$1:$E$1000,$D$1))) in cell a1 to =Rank(E1,$E$1:$E$50). Then if you would like 50 random generated "unique numbers." you simply drag the formula through column a to cell a50. It is a lot simpler. Thank you for answering my question regardless of the huge unneeded formula. If you did not have this website. I don't think I would have been able to solve my problem. #WAR Jiggly
This comment was minimized by the moderator on the site
Actually, if you have two equal values, rank will give the same value to both. Rank formula does return repeated rank values.
This comment was minimized by the moderator on the site
Manuel Ramirez.

The formula RAND() has hundreds of billions of possibilities, but even so you can use a conditional to not repeat the numbers:
A1 = Rank(E1,$E$1:$E$50)
A2 = IF(COUNTIFS($E$1:E1;E1)>1;A1+1;Rank(E2,$E$1:$E$50)
This comment was minimized by the moderator on the site
Hi, Base on Generate unique random numbers with formulas , How can I specify the starting point of a random number? Let's say I want to random "15 to 30".
This comment was minimized by the moderator on the site
Use RANDBETWEEN() to get random numbers lies between two numbers.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations