Excel表里面有好多数字 需要组合成一个总数怎么弄

2133
5784
780
3180
1715
3203
1400
1920
744
2096
1750
6970
5065
8437
2156
1600
4518
2263
2663
2000
2303
2040
1400
1476
1400
1664
5000
3866
2133
5784
780
3180
1715
3203
1400
1920
744
2096
1750
6970
5065
8437
2156
1600
4518
2263
2663
2000
2303
2040
1400
1476
1400
1664
5000
3866
这么多数字里面如何 拼凑出11709这个数字~ 大神们感谢

我试用VBA试一试,共有113个不重复的组合可累加为11709的:

以下是求由9个数组合的程序,求其它个数的可删减其程序,我用了3 个多小时求出以上结果的。

Sub TEST()
Dim a  As Integer, b  As Integer, c  As Integer, d  As Integer, e  As Integer, f  As Integer, g  As Integer, h  As Integer, i  As Integer, j As Integer, k As Integer
k = 0
For b = 1 To 48
For c = b + 1 To 49
For d = c + 1 To 50
For e = d + 1 To 51
For f = e + 1 To 52
    If Cells(b, 1) + Cells(c, 1) + Cells(d, 1) + Cells(e, 1) + Cells(f, 1) > 11709 Then
        Exit For
    Else
Cells(1, 16) = "'" & b & c & d & e
For g = f + 1 To 53
    If Cells(b, 1) + Cells(c, 1) + Cells(d, 1) + Cells(e, 1) + Cells(f, 1) + Cells(g, 1) > 11709 Then
        Exit For
    Else
For h = g + 1 To 54
    If Cells(b, 1) + Cells(c, 1) + Cells(d, 1) + Cells(e, 1) + Cells(f, 1) + Cells(g, 1) + Cells(h, 1) > 11709 Then
        Exit For
    Else
For i = h + 1 To 55
    If Cells(b, 1) + Cells(c, 1) + Cells(d, 1) + Cells(e, 1) + Cells(f, 1) + Cells(g, 1) + Cells(h, 1) + Cells(i, 1) > 11709 Then
        Exit For
    Else
For j = i + 1 To 56
    If Cells(b, 1) + Cells(b, 1) + Cells(c, 1) + Cells(d, 1) + Cells(e, 1) + Cells(f, 1) + Cells(g, 1) + Cells(h, 1) + Cells(i, 1) + Cells(j, 1) > 11709 Then
        Exit For
    Else
    If Cells(b, 1) + Cells(c, 1) + Cells(d, 1) + Cells(e, 1) + Cells(f, 1) + Cells(g, 1) + Cells(h, 1) + Cells(i, 1) + Cells(j, 1) = 11709 Then
'    If Cells(a, 1) + Cells(b, 1) + Cells(c, 1) + Cells(d, 1) + Cells(e, 1) + Cells(f, 1) + Cells(g, 1) + Cells(h, 1) + Cells(i, 1) + Cells(j, 1) = 11709 Then
        k = k + 1
'        Cells(k, 3) = Cells(a, 1)
        Cells(k, 4) = Cells(b, 1)
        Cells(k, 5) = Cells(c, 1)
        Cells(k, 6) = Cells(d, 1)
        Cells(k, 7) = Cells(e, 1)
        Cells(k, 8) = Cells(f, 1)
        Cells(k, 9) = Cells(g, 1)
        Cells(k, 10) = Cells(h, 1)
        Cells(k, 11) = Cells(i, 1)
        Cells(k, 12) = Cells(j, 1)
    End If
    End If
Next
End If
Next
End If
Next
End If
Next
End If
Next
Next
Next
Next
Next
End Sub

温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-08-24
使用连接符&或者是使用CONCATENATE()函数都可以办到。
例如我想要连接A1,B1两个单元格中的数字,可以
用=A1&B1或者是=CONCATENATE(A1,B1)。
例如A1中的数字是520,B1中的数字是1314,在C1中键入前面所说的两种方法中的任意一种,均可以在C1中显示“5201314”。
以上方法中最终得到的结果会是一个“文本型数字”,如果再进行运算的话可能会出现错误,可以在公式前面再套用一个VALUE函数来解决这个小问题,即将公式修改为=VALUE(A1&B1)或者是=VALUE(CONCATENATE(A1,B1))就能解决了。本回答被网友采纳
第2个回答  2017-08-24
求和,选中上面的数字,工具栏里点自动求和
第3个回答  2017-08-24
这个要求要用vba编程来实现,我研究一下看
相似回答