- ·上一篇:怎么给excel表格图表加横坐标
- ·下一篇:excel表格坐标轴怎么跳段
excel表格带数量的怎么合值
1.怎么在Excel表格中算出一行数字的和值
如图,一行4个数字,在E1单元格求它们的和。
方法一
1、点击格式工具栏上的求和按钮即可。
2、点击后,显示在E1单元格的是求和函数“=SUM(A1:D1)”
3、回车后显示结果。
方法二
在E1单元格输入“=a1+b1+c1+d1”回车即可求和。
2.一个N多行的EXCEL文档,怎么样才可以使连续行合值范围在300~
这么复杂,你要的就是合计数在300-350之间,对吧,我试下
Sub asdf() Dim col As Integer col = 1 '需要求和的列 cold = 2 '放置结果的列 i = 1 '总行数 t = 0 st = 1 Do Until Range("a" + Format(i)).Value = "" t = t + Cells(Format(i), col) If t + Cells(Format(i + 1), col) > 350 Then Range(Chr(97 + cold) + Format(i)).Value = "=sum(" & Chr(96 + col) & Format(st) & ":" & Chr(96 + col) & Format(i) & ")" st = i + 1 t = 0 End If i = i + 1 Loop If Range(Chr(96 + col) + Format(i)).Value = "" Then Range(Chr(97 + cold) + Format(i - 1)).Value = "=sum(a" & Format(st) & ":a" & Format(i - 1) & ")" End If End Sub
完善后:
Sub 计算() Dim col As Integer col = 1 '需要求和的列 cold = 3 '放置结果的列 i = 1 '总行数 t = 0 st = 1 Do Until Range("a" + Format(i)).Value = "" t = t + Cells(Format(i), col) If t + Cells(Format(i + 1), col) > 350 Then Cells(i, cold) = "=sum(" & Chr(96 + col) & Format(st) & ":" & Chr(96 + col) & Format(i) & ")" st = i + 1 t = 0 End If i = i + 1 Loop If Range(Chr(96 + col) + Format(i)).Value = "" Then Cells(i - 1, cold) = "=sum(a" & Format(st) & ":" & Chr(96 + col) & Format(i - 1) & ")" End If End Sub