The following is a formula for randomly selecting 5 numbers from all: ```less =INDEX($A$1:$E$7,INDEX(COLUMN(),RAND()*7+1,1)) ``` This formula will select a random number from A1 to E7, and ensure that the selected number is not duplicate with other selected numbers. Explanation: -INDEX (COLUMN(), RAND() * 7+1,1) Writing ` (INDEX (COLUMN(), RAND() * 7+1), 1) ` means to select a random number in the range of column numbers (from 1 to 7) and multiply it by a constant to increase randomness. -INDEX ($A $1: $E $7, INDEX (COLUMN(), RAND() * 7+1,1)) will nest the above two parts to ensure that the selected number is in the range of A1 to E7. This formula can help you select 5 numbers randomly from all, and ensure that there is no repetition.If you need more help, please feel free to ask me questions.
Excel has a permutation and combination formula, PERMUT is the permutation function, and COMBIN is the combination function. 1. The computer opens the Excel table and enters the combination function=COMBIN (50,3).
2. Enter and you will get 19600.
3. Enter the arrangement formula=PERMUT (50,3)/PERMUT (3,3).
Sub musub() Dim caseArray(3) As String caseArray(0) = A caseArray(1) = B caseArray(2) = C caseArray(3) = D Dim rowNum As Integer For i = 1 To 4 For j = 1 To 4 For k = 1 To 4 For l = 1 To 4 rowNum = rowNum + 1 Cells (rowNum, 1)=Situation&CStr (rowNum) Cells(rowNum, 2) = caseArray(i - 1) Cells (rowNum, 3)=c price point special and book aseArray (j - 1) Cells(rowNum, 4) = caseArray(k - 1) Cells(rowNum, 5) = caseArray(l - 1) Next l Next k Next j Next i End Sub