当前位置:首页教育技巧excel技巧excel筛选

excel表格带数量的怎么合值

2024-07-04 09:16:23


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

相关信息


电脑版

【免责声明】本站信息来自网友投稿及网络整理,内容仅供参考,如果有错误请反馈给我们及时更正,对文中内容的真实性和完整性本站不提供任何保证,不承但任何责任。
版权所有:学窍知识网 Copyright © 2011-2024 www.at317.com All Rights Reserved .