有1 2 3 4 5 五个数 如何用EXCEL求任意3个数之积的和(3个数的组合不重复),任意4个数积之和等等
有1 2 3 4 5 五个数 如何用EXCEL求任意3个数之积的和(3个数的组合不重复),任意4个数积之和等等
答案:1 悬赏:30 手机版
解决时间 2021-08-13 09:36
- 提问者网友:缘字诀
- 2021-08-12 13:02
最佳答案
- 五星知识达人网友:毛毛
- 2021-08-12 13:17
用VBA可做,把任意5个数放在A1:A5
任意3个数之积的和
Sub S3()
Dim i1 As Integer,i2 As Integer,i3 As Integer
Dim s As Integer
s = 0
For i1 = 1 To 3
For i2 = i1 + 1 To 4
For i3 = i2 + 1 To 5
s = s + Range(A & i1) * Range(A & i2) * Range(A & i3)
Next i3
Next i2
Next i1
MsgBox (S= & s)
End Sub
任意4个数之积的和
Sub S4()
Dim i1 As Integer,i2 As Integer,i3 As Integer,i4 As Integer
Dim s As Integer
s = 0
For i1 = 1 To 2
For i2 = i1 + 1 To 3
For i3 = i2 + 1 To 4
For i4 = i3 + 1 To 5
s = s + Range(A & i1) * Range(A & i2) * Range(A & i3) * Range(A & i4)
Next i4
Next i3
Next i2
Next i1
MsgBox (S= & s)
End Su
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯