Skip i'r prif gynnwys

Sut i gynhyrchu rhif ar hap heb ddyblygu yn Excel?

Mewn llawer o achosion, efallai yr hoffech chi gynhyrchu rhifau ar hap yn Excel? Ond gyda'r fformwlâu cyffredinol i hapoli rhifau, efallai y bydd rhai gwerthoedd dyblyg. Yma, dywedaf wrthych rai triciau i gynhyrchu rhifau ar hap heb ddyblygu yn Excel.

Cynhyrchu rhifau ar hap unigryw gyda fformwlâu

Cynhyrchu rhif hap unigryw gyda Kutools ar gyfer Mewnosod Data Ar Hap Excel (Hawdd!) syniad da3


swigen dde glas saeth Cynhyrchu rhifau ar hap unigryw gyda fformwlâu

I gynhyrchu'r rhifau ar hap unigryw yn Excel, mae angen i chi ddefnyddio dau fformiwla.

1. Tybiwch fod angen i chi gynhyrchu rhifau ar hap heb ddyblygu i golofn A a cholofn B, nawr dewiswch gell E1, a theipiwch y fformiwla hon = RAND (), yna pwyswch Rhowch allwedd, gweler y screenshot:
doc-randomize-no-ailadrodd-1

2. A dewiswch y golofn E gyfan trwy wasgu Ctrl + Gofod allweddi ar yr un pryd, ac yna pwyswch Ctrl + D allweddi i gymhwyso'r fformiwla = RAND () i'r golofn gyfan E. Gweler y screenshot:
doc-randomize-no-ailadrodd-2

3. Yna yn y gell D1, teipiwch y nifer uchaf o'ch rhif ar hap sydd ei angen. Yn yr achos hwn, rwyf am fewnosod rhifau ar hap heb eu hailadrodd rhwng 1 a 50, felly byddaf yn teipio 50 yn D1.
doc-randomize-no-ailadrodd-3

4. Nawr ewch i Golofn A, dewiswch gell A1, teipiwch y fformiwla hon =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))), yna llusgwch y ddolen llenwi i'r golofn B nesaf, a llusgwch y handlen llenwi i'r ystod sydd ei hangen arnoch chi. Gweler y screenshot:
doc-randomize-no-ailadrodd-4

Nawr, yn yr ystod hon, nid yw'r rhifau ar hap sydd eu hangen arnoch yn cael eu hailadrodd.

Nodyn:

1. Yn y fformiwla hir uchod, mae A1 yn nodi'r gell rydych chi'n defnyddio'r fformiwla hir, mae D1 yn nodi uchafswm y rhif ar hap, E1 yw'r gell gyntaf o golofn rydych chi'n defnyddio fformiwla = RAND (), ac mae 2 yn nodi eich bod chi am fewnosod rhif ar hap yn ddwy golofn. Gallwch eu newid fel eich angen.

2. Pan fydd yr holl rifau unigryw yn cael eu cynhyrchu i'r amrediad, bydd y celloedd diangen yn cael eu dangos yn wag.

3. Gyda'r dull hwn, gallwch gynhyrchu rhifau ar hap yn cychwyn o rif 1. Ond gyda'r ail ffordd, gallwch chi nodi'r ystod rhifau ar hap yn hawdd.


swigen dde glas saeth Cynhyrchu rhif hap unigryw gyda Kutools ar gyfer Mewnosod Data Ar Hap Excel

Gyda'r fformwlâu uchod, mae gormod o anghyfleustra i'w drin. Ond gyda Kutools ar gyfer Excel'S Mewnosod Data ar Hap nodwedd, gallwch yn gyflym ac yn hawdd fewnosod y rhifau ar hap unigryw fel eich angen a fydd yn arbed llawer o amser.

Llai o Amser ond Cynhyrchedd Uwch

Yn cynnwys 300+ o offer proffesiynol ar gyfer Excel 2019-2003
Rhyddhawyd fersiwn gyntaf 1.0 yn 2011, nawr yw'r fersiwn 18.0
Yn datrys y mwyafrif o dasgau cymhleth dyddiol Excel mewn eiliadau, arbedwch eich amser
Treial 30 diwrnod am ddim heb unrhyw gyfyngiad

kte 包装 盒

Ar ôl gosod Kutools ar gyfer Excel, gwnewch fel isod:(Lawrlwythiad Am Ddim Kutools ar gyfer Excel Nawr!)

1. Dewiswch yr ystod sydd ei hangen arnoch i gynhyrchu rhifau ar hap, a chlicio Kutools > Mewnosod > Mewnosod Data ar Hap. Gweler y screenshot:

2. Yn y Mewnosod Data ar Hap deialog, ewch i'r Cyfanrif tab, teipiwch yr ystod rhif sydd ei angen arnoch chi yn y O ac I blychau testun, a chofiwch wirio Gwerthoedd unigryw opsiwn. Gweler y screenshot:

3. Cliciwch Ok i gynhyrchu'r rhifau ar hap ac ymadael â'r ymgom.

Nodyn:Os yw'r celloedd a ddewiswyd gennych yn fwy na'r hap-rifau, mae'r celloedd diangen yn cael eu harddangos fel rhai gwag.

Gallwch hefyd fewnosod y dyddiad unigryw ar hap, amser unigryw ar hap erbyn Mewnosod Data ar Hap. Os ydych chi am gael treial am ddim o Mewnosod Data ar Hap, os gwelwch yn dda downloan ar hyn o bryd!
mewnosod data ar hap

Awgrym.Os ydych chi am ddewis neu ddidoli data ar hap, ceisiwch ddefnyddio'r Kutools ar gyfer Excel's Trefnu Ystod ar Hap fel y dangosir yn y screenshot canlynol. Mae'n swyddogaeth lawn heb gyfyngiad mewn 30 diwrnod, lawrlwythwch a chael treial am ddim nawr.

doc dewis ar hap


swigen dde glas saeth Mewnosod Data ar Hap Heb Dyblyg




Mewnosodwch flychau gwirio neu fotymau lluosog yn gyflym mewn ystod o gelloedd yn y daflen waith

Yn Excel, dim ond unwaith y gallwch chi fewnosod un blwch gwirio / botwm, bydd yn drafferthus os oes angen mewnosod blychau gwirio / botymau ar yr un pryd. Kutools ar gyfer Excel mae ganddo gyfleustodau pwerus - Gwiriad Mewnosod Swp Blychau / Mewnosod Swp Botymau Opsiwn yn gallu mewnosod blychau gwirio / botymau yn y celloedd a ddewiswyd gydag un clic.  Cliciwch am dreial llawn sylw am ddim mewn 30 diwrnod!
mewnosod doc botwm opsiwn blwch gwirio
 
Kutools ar gyfer Excel: gyda mwy na 300 o ychwanegion Excel defnyddiol, am ddim i geisio heb unrhyw gyfyngiad mewn 30 diwrnod.

Offer Cynhyrchiant Swyddfa Gorau

🤖 Kutools AI Aide: Chwyldro dadansoddi data yn seiliedig ar: Cyflawniad Deallus   |  Cynhyrchu Cod  |  Creu Fformiwlâu Personol  |  Dadansoddi Data a Chynhyrchu Siartiau  |  Invoke Swyddogaethau Kutools...
Nodweddion Poblogaidd: Darganfod, Amlygu neu Adnabod Dyblygiadau   |  Dileu Rhesi Gwag   |  Cyfuno Colofnau neu Gelloedd heb Colli Data   |   Rownd heb Fformiwla ...
Super-edrych: VLookup Meini Prawf Lluosog    VLookup Gwerth Lluosog  |   VLookup Ar Draws Taflenni Lluosog   |   Edrych Niwlog ....
Rhestr gwympo Uwch: Creu Rhestr Gollwng yn Gyflym   |  Rhestr Gollwng Dibynnol   |  Rhestr Gollwng Aml-ddewis ....
Rheolwr Colofn: Ychwanegu Nifer Penodol o Golofnau  |  Symud Colofnau  |  Toglo Statws Gwelededd Colofnau Cudd  |  Cymharwch Ystodau a Cholofnau ...
Nodweddion dan Sylw: Ffocws ar y Grid   |  Golwg Dylunio   |   Bar Fformiwla Mawr    Rheolwr Llyfr Gwaith a Thaflen   |  Llyfrgell Adnoddau (Testun Auto)   |  Dewiswr Dyddiad   |  Cyfuno Taflenni Gwaith   |  Amgryptio/Dadgryptio Celloedd    Anfon E-byst trwy Restr   |  Hidlo Super   |   Hidlo Arbennig (hidlo mewn print trwm/italig/strikethrough...) ...
15 Set Offer Gorau12 Testun offer (Ychwanegu Testun, Dileu Cymeriadau,...)   |   50 + Siart Mathau (Siart Gantt,...)   |   40+ Ymarferol Fformiwlâu (Cyfrifwch oedran yn seiliedig ar ben-blwydd,...)   |   19 mewnosod offer (Mewnosod Cod QR, Mewnosod Llun o'r Llwybr,...)   |   12 Trosi offer (Rhifau i Eiriau, Trosi arian cyfred,...)   |   7 Uno a Hollti offer (Rhesi Cyfuno Uwch, Celloedd Hollt,...)   |   ... a mwy

Supercharge Eich Sgiliau Excel gyda Kutools ar gyfer Excel, a Phrofiad Effeithlonrwydd Fel Erioed Erioed. Kutools ar gyfer Excel Yn Cynnig Dros 300 o Nodweddion Uwch i Hybu Cynhyrchiant ac Arbed Amser.  Cliciwch Yma i Gael Y Nodwedd Sydd Ei Angen Y Mwyaf...

Disgrifiad


Mae Office Tab yn dod â rhyngwyneb Tabbed i Office, ac yn Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
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