EXCEL任意排列函数
发布网友
发布时间:2022-04-23 02:22
我来回答
共4个回答
热心网友
时间:2022-07-14 08:51
用两个公式可以解决:
在A1输入公式:
=SMALL(IF(ISNUMBER(FIND(1,ROW($12345:$54321))*FIND(2,ROW($12345:$54321))*FIND(3,ROW($12345:$54321))*FIND(4,ROW($12345:$54321))*FIND(5,ROW($12345:$54321))),ROW($12345:$54321),55555),ROW())
公式以CTRL+SHIFT+ENTER三键结束。
将公式向下复制到120行。
在B1输入公式:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,1,"a"),2,"b"),3,"c"),4,"d"),5,"e")
将公式向下复制到相应行。
热心网友
时间:2022-07-14 08:51
abcde分别在A1:A5
Sub a()
Dim i1 As Integer, i2 As Integer, i3 As Integer, i4 As Integer, i5 As Integer
Dim arr(1 To 10000, 1 To 1) As String, d As Object, i As Integer
Set d = CreateObject("scripting.dictionary")
i = 1
For i1 = 1 To 5
For i2 = 1 To 5
For i3 = 1 To 5
For i4 = 1 To 5
For i5 = 1 To 5
d(Cells(i5, 1).Value) = ""
d(Cells(i4, 1).Value) = ""
d(Cells(i3, 1).Value) = ""
d(Cells(i2, 1).Value) = ""
d(Cells(i1, 1).Value) = ""
If d.Count = 5 Then
arr(i, 1) = Join(d.keys, "")
i = i + 1
End If
d.RemoveAll
Next i5
Next i4
Next i3
Next i2
Next i1
[b1:B120] = arr
End Sub
热心网友
时间:2022-07-14 08:51
提供一种分步实现的方法,你从B1开始输入,行,输入完成后,全部选中,复制,点A2单元格,选择性粘贴,转置,在B2输入公式=,$A2&B$1,右拉,下拉就完成两个元素的排列,再以全部两个元素为一行或列,单个元素为列或行,同理完成三个元素的排列,然后是四个元素,五个元素。。。。
热心网友
时间:2022-07-14 08:52
函数出这个结果。。。。。。
还是用VBA吧。